FWIW, I've built out my own sync solution between CoreData and CloudKit, and it took some considerable forethought to support background uploads and downloads of binary data, separate from syncing CKRecord changes over time.
CloudCore manages its own CKFetch and CKModify operations like so…
func longLivedConfiguration(qos: QualityOfService) -> CKOperation.Configuration {
let configuration = CKOperation.Configuration()
configuration.container = container
configuration.isLongLived = true
configuration.qualityOfService = qos
return configuration
}
record["asset"] = CKAsset(fileURL: cacheable.url)
uploadOp = CKModifyRecordsOperation(recordsToSave: [record]…)
uploadOp.configuration = self.longLivedConfiguration(qos: .utility)
uploadOp.savePolicy = .changedKeys
It would be great to know if/when NSCloudKitContainer handles something like this.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: