CloudKit Offline Cache

I am making an app that uses CloudKit for its persistent store. However, if a user of the app is in a place without cell or data service, I would like them to see the last known set of data.


I could probably copy all the record properties into a dictionary and save in NSUserDefaults, but that seems like a poor choice. Surely there is some sort of better persistent store for CKRecords that can be loaded the an app comes to the foreground, in case CloudKit is unavailable.

CloudKit is not a model layer, it's a networking layer. You should not operate on bare CKRecords, at least when you're trying to handle offline mode. You should make external model classes that consumes CKRecords and could be stored via NSUserDefaults/Keychain/CoreData.

CloudKit Offline Cache
 
 
Q