small medium large xlarge

iCloud for Developers: Automatically Sync Your iOS Data, Everywhere, All the Time


Cover image for iCloud for Developers

iCloud for Developers

Automatically Sync Your iOS Data, Everywhere, All the Time


Get up-to-date fast on the techniques you need get your applications iCloud-ready. With Apple’s iCloud servers now available to developers, there’s every reason to make synchronization a core feature of your product. You’ll learn how to iCloud-enable the data formats you’re most likely to use in an iOS application: key-value data, document-based data, and relational data. Using a simple grocery list application as an example, you’ll find out how to configure any application to make the most of iCloud’s capabilities.

Customer Reviews

Cesare does an excellent job demonstrating how iCloud works and how you can
work best within its expectations. His style is easy to follow, and he breaks it
down into simple steps, but he doesn’t hold back and pretend that the complexity
isn’t there. You’ll be building useful apps on iCloud in no time. Don’t hesitate to
buy this book.

- Jonathan Penn

iCloud for Developers guides you through the three core features of iCloud: keyvalue
store, documents, and CoreData. Each section has great examples to help
you learn how to use the feature to its full potential. Buy this book if you want to
learn about iCloud!

- Matt Galloway

The cloud can be a confusing topic, but Cesare makes it easy. He shows you how
to add iCloud into a real app step-by-step, covering all the juicy bits you’ll want
to know along the way. If you want to use iCloud in your apps, this is the book
for you!

- Ray Wenderlich

See All Reviews

About this Title

Pages: 136
Published: 2013-07-15
Release: P2.0 (2014-08-07)
ISBN: 978-1-93778-560-4

Your app’s users want their application data to be in sync as they switch from one device to another. Guided by iOS expert Cesare Rocchi, you’ll start by learning how to configure an app and its resources for iCloud. Then, after a quick introduction to iCloud-supported data types, you’ll work on using the simplest: key-value data.

Next, you’ll find out how to get your document-based data (including media files), and even relational data working with iCloud. As you learn each new technique, you’ll use it to synchronize yet another module of the book’s sample app, Grocery, a simple shopping list that can be shared between two or more devices. You’ll learn how to handle the kinds of conflicts likely to occur when you build apps that keep themselves in sync across phones and tablets, as well as how to deal with the notifications used by iCloud to broadcast changes as they occur.

As devices proliferate, synchronization is more important than ever. When you finish this book, you’ll know how to make it a part of your own applications.

What You Need

You should have Xcode 4.6.2 and iOS SDK 6.0 installed on your workstation. To write apps that interact with iCloud, you need to be a registered Apple developer. To test the synchronization of iCloud applications that you write, you’ll need two iOS devices (either of which can be an iPhone, iPod, or iPad).

Contents & Extracts



  • Preparing Your Application for iCloud excerpt
    • What Is iCloud?
    • What’s Behind iCloud
    • Introducing the Grocery Application
    • Enabling Your Application for iCloud
    • Checking for iCloud Availability
    • Moving On
  • Working with Key-Value Data
    • iCloud Storage Types
    • Using Key-Value Pairs with iCloud
    • Using Key-Value Pairs in Grocery
    • Reacting to Changes in iCloud
    • Key-Value Storage Limitations
    • Moving On
  • Working with Documents excerpt
    • Interacting with iCloud
    • Extending the UIDocument Class
    • Modeling a Grocery Item as a UIDocument
    • Displaying a Grocery Item
    • Moving On
  • Managing Multiple Files and iCloud Notifications
    • Creating and Managing Multiple Files
    • Creating and Managing Multiple Grocery Items
    • Managing Updates While an Application Is Running
    • Editing Grocery Item Content
    • Moving On
  • Wrapping Items in a Single File
    • Working with File Packages
    • Packaging Grocery Items
    • Updating the User Interface
    • Moving On
  • Handling Nontextual Information in a Data Model
    • Working with Data in Packages
    • Associating Images with Names
    • Updating the User Interface
    • Moving On
  • Handling Conflicts
    • Working with Document States and Notifications
    • Preventing Conflicts Between Grocery Items
    • Resolving Conflicts Between Grocery Items
    • Moving On
  • Working with Core Data and iCloud
  • Bibliography


Cesare Rocchi is a speaker, book author, UX designer, and developer specializing in web and mobile applications. He began working on interactive applications fifteen years ago, while he was a researcher in academia. He runs Studio Magnolia, an interactive studio that creates compelling web and mobile applications. You can find him on Twitter as @_funkyboy.