Potential problem with synching users' private CloudKit with NSPersistentCloudKitContainer

Imagine I have a game with new levels every day. Users play my game and their progress is saved in Core Data, which is then synchronized with CloudKit via NSPersistentCloudKitContainer.

Users' progress is about 500Kb for each level/day.

That's 5 Mb in 10 days. Or 182 Mb in a year.

If the user plays my game for a year, gets a new iPhone, and installs my app again — will the NSPersistentCloudKitContainer eventually download all 182 Mb of users' data!?

Answered by deeje in 759817022

Yes. the current design of NSPersistentCloudKitContainer is to sync everything. There are other sync engines available between CoreData and CloudKit, such as CKSyncEngine in iOS 17, and open source sun engines like CloudCore, which might provide more fine-grain control over sync. And of course, you can always write your own that best suits your needs.

Accepted Answer

Yes. the current design of NSPersistentCloudKitContainer is to sync everything. There are other sync engines available between CoreData and CloudKit, such as CKSyncEngine in iOS 17, and open source sun engines like CloudCore, which might provide more fine-grain control over sync. And of course, you can always write your own that best suits your needs.

Potential problem with synching users' private CloudKit with NSPersistentCloudKitContainer
 
 
Q