Add SyncEngine.pendingChangeCounts#500
Open
gigq wants to merge 1 commit into
Open
Conversation
This makes the pending save, delete, and database change counts available for things like debug and diagnostics views. It returns nil when the sync engine isn’t running and updates when CKSyncEngine reports a state change.
mbrandonw
reviewed
Jul 16, 2026
| /// | ||
| /// This value is `nil` when the sync engine is not running. It is observable, and so accessing | ||
| /// it from a SwiftUI view will cause the view to update as the pending changes change. | ||
| public var pendingChangeCounts: PendingChangeCounts? { |
Member
There was a problem hiding this comment.
Does this really need to be optional? You already know if the engine is running or not via the public isRunning property, and so shouldn't this property always reflect the pending changes, regardless of running or not?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the pending save, delete, and database change counts available for things like debug and diagnostics views. It returns nil when the sync engine isn’t running and updates when CKSyncEngine reports a state change.
Tested this in my app, count changes come in live as expected.