colindunn
colindunn

Reputation: 3163

iOS Swift: Local persistence with CloudKit

I'm using CloudKit to fetch/store data but would also like to have a local persistence layer. Does CloudKit offer any kind of local storage capabilities? Or should I use NSUserDefaults (NSKeyedArchiver/NSKeyedUnarchiver)?

Upvotes: 8

Views: 4230

Answers (2)

Ben
Ben

Reputation: 3862

No caching built in CloudKit, anyway when you implement one Keep in mind to cache only the system fields to restore and synch with CloudKit again check this https://stackoverflow.com/a/35355916/1787109

Upvotes: 0

Edwin Vermeer
Edwin Vermeer

Reputation: 13127

There is no mechanism for cashing data locally in CloudKit, you have to do that yourself. I can suggest you to take a look at EVCloudKitDao which is a convenience library for CloudKit that has support for local cashing to a file.

Upvotes: 3

Related Questions