How to detect changes in iCloud Key/Value Data

Now that we can read from and write to iCloud, how will we know when another device may have written new data?

We’ll do this by adding an observer and listening to a special message iCloud transmits every time new data is available. The message has the catchy title NSUbiquitousKeyValueStoreDidChangeExternallyNotification.

Here’s how we can setup such an observer. This calls a method (newCloudData) in which you can react to the changes:

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.