Strategy for Limiting CloudKit Activity / Refreshing

Are there good ways to guide an app to pause iCloud syncing if the app is busy with an intensive activity? Also, is there a way to suggest that it check iCloud for updates?

Answered by Frameworks Engineer in 890678022

If you are using CKSyncEngine or NSPersistentCloudKitContainer this should largely be handled for you as both support discretionary scheduling and listen for remote database changes.

For CKSyncEngine in particular you can set the NSQualityOfService of the underlying CKOperations via defaultConfiguration found under the CKSyncEngine.FetchChangesOptions or CKSyncEngine.SendChangesOptions on CKSyncEngineDelegate if you need further control.

For more information, especially if you are writing your own sync engine, please see CKOperation.

Accepted Answer

If you are using CKSyncEngine or NSPersistentCloudKitContainer this should largely be handled for you as both support discretionary scheduling and listen for remote database changes.

For CKSyncEngine in particular you can set the NSQualityOfService of the underlying CKOperations via defaultConfiguration found under the CKSyncEngine.FetchChangesOptions or CKSyncEngine.SendChangesOptions on CKSyncEngineDelegate if you need further control.

For more information, especially if you are writing your own sync engine, please see CKOperation.

Strategy for Limiting CloudKit Activity / Refreshing
 
 
Q