Graphics Programs Reference
In-Depth Information
30
iCloud
iCloud is a service that is available on every iOS device running iOS 5 or later. At its most
basic level, iCloud is a mechanism for storing files “in the cloud,” i.e. one or many remote
servers. iCloud ties the stored data to a particular user in individual iCloud accounts. When
you purchase an iOS device, you set that device up with your iCloud account. If you own
other devices, you can associate them with your account, too. The shared data in the iCloud
is available only to the user logged into the device. If another user logs into the device
(which is rare), access to the original user's iCloud data is removed.
There are two big features of iOS that use iCloud - key-value storage and document stor-
age.
Key-value storage allows an application to synchronize preferences-like data across
devices. For example, an application that allowed you to read topics from a bookshelf
might use this feature. You could begin reading a book on your iPad. If you later opened
this application on your iPhone, it would open directly to the same book right where you
left off reading on your iPad. The current book and location would be the data stored in
iCloud. This type of data is stored and retrieved using the class NSUbiquit-
ousKeyValueStore , which works much like NSUserDefaults .
Document storage lets you manage individual documents across the user's devices. For ex-
ample, an application might allow you to create and edit spreadsheets. You could create a
spreadsheet on an iPhone and then edit it on an iPad. When you next opened the spread-
sheet on the iPhone, the changes from the iPad would be there. This feature is exposed
through the classes UIDocument , NSFileCoordinator , NSMetadataQuery , and
the protocol NSFilePresenter .
Core Data leverages iCloud's document storage to synchronize a Core Data SQLite file
across a number of iOS devices. In this chapter, you will synchronize the read list for Nerd-
feed across all of the user's devices using Core Data's built-in iCloud behavior.
Search WWH ::




Custom Search