Reputation: 133
I plan to make a toggle button so the user can choose if they want to sync local data with iCloud or not, to provide more privacy for user.
but it seems I can only choose either using iCloud(NSPersistentCloudKit) or not(NSPersistentKit)
I couldn't find NSPersistentCloudkit providing disable function, or if the data was previously store in local device, can it sync to cloud with some settings in NSPersistentCloudkit?
or does it as WWDC19 says, if would take thousand lines of codes?
Upvotes: 0
Views: 991
Reputation: 133
I found some answers, not yet try myself. But in case any reader with similar question urgently.
This one seems providing the whole solution (ios13 ): https://fluffy.es/toggle-icloud-sync-nspersistentcloudkitcontainer/
Please also note, above deleting the iCloud copy once user choosing not to sync, while https://developer.apple.com/forums/thread/118924 suggesting not to do that.
Upvotes: 2