-
Notifications
You must be signed in to change notification settings - Fork 76
Better support for sharing in previews. #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| struct CountersListView: View { | ||
| @FetchAll var counters: [Counter] | ||
| @FetchAll( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the CloudKitDemo to show an icon next to counters that are shared. We can now explore that functionality in previews thanks to the changes in this PR.
| package let databaseScope: CKDatabase.Scope | ||
| let _container = IsolatedWeakVar<MockCloudContainer>() | ||
| let dataManager = Dependency(\.dataManager) | ||
| let deletedRecords = LockIsolated<[(CKRecord.ID, CKRecord.RecordType)]>([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We keep track of records deleted from the mock cloud database so that when fetching changes we can fetch deletions.
| syncEngine: syncEngine | ||
| ) | ||
| } else { | ||
| Form { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now emulate a cloud sharing view in previews!
|
I scaled this PR back a bit since we went with a simpler model for emulating automatic sync in previews. |
We can emulate iCloud sharing in previews by making some updates to our mocks that power the sync engine.