Ubiquity Containers

Now on to the fun stuff. So far, you know that every file that an application saves and loads is within the application’s sandbox. These files are only available to the application that owns the sandbox, and they only exist on the device on which they were created. iCloud changes this situation with special directories called ubiquity containers.

You can think of a ubiquity container as a folder that lives on Apple’s iCloud servers. An iOS device keeps a local copy of the ubiquity container on its filesystem. When an iOS device makes changes to the files in its local copy, those changes are automatically uploaded to the actual ubiquity container in the cloud. Any other device that has access to that ubiquity container then ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.