How to persist CKServerChangeToken etc startup data for an App.

How to persist CKServerChangeToken etc startup data for an App?

The app wants to make the serverChangeToken persistent, so that on the startup,

it won't fetch all the changes since the begining. Anyway to do it?

use userDefaults?


https://developer.apple.com/library/archive/samplecode/CloudKitShare/Listings/CloudShares_TopicLocalCache_swift.html

used the serverChangeToken, but didn't make it persistent.

Replies

I believe you can simply save it to


[[NSUserDefaults standardUserDefaults] setObject:myCKServerChangeToken forKey@"TheToken"];