Contents

About Incorporating iCloud into Your App

Describes how to incorporate iCloud into your app.

At a Glance

iCloud is all about content, so your integration effort focuses on the model layer of your app. Because instances of your app running on a user’s other devices can change the local app instance’s data model, you design your app to handle such changes. You might also need to modify the user interface for presenting iCloud-based files and data.

In one important case, Cocoa adopts iCloud for you: A document-based app for OS X v10.8 or later requires very little iCloud adoption work, thanks to the capabilities of the NSDocument class.

There are many different ways you can use iCloud storage, and a variety of technologies available to access it. This document introduces all the iCloud storage APIs and offers guidance in how to design your app in the context of iCloud.

iCloud Supports User Workflows

Adopting iCloud key-value and document storage in your app lets your users begin a workflow on one device and finish it on another.

Say you provide a podcast app. A commuter subscribes to a podcast on his iPhone and listens to the first 20 minutes on his way to work. At the office, he launches your app on his iPad. The episode automatically downloads and the play head advances to the point he was listening to.

For a drawing app, an architect creates some sketches on her iPad while visiting a client. On returning to her studio, she launches your app on her iMac. All the new sketches are already there, waiting to be opened and worked on.

To store state information for the podcast app in iCloud, you’d use iCloud key-value storage. To store the architectural drawings in iCloud, you’d use iCloud document storage.

Relevant Chapter: iCloud Fundamentals (Key-Value and Document Storage)

Many Kinds of iCloud Storage

There are four iCloud storage APIs to choose from. To pick the right one (or combination) for your app, make sure you understand the purpose and capabilities of each. The iCloud storage types are:

Key-value storage for discrete values, such as preferences, settings, and simple app state.

iCloud document storage for user-visible file-based information such as word-processing documents, drawings, and complex app state.

Core Data storage for shoebox-style apps and server-based, multidevice database solutions for structured content. iCloud Core Data storage is built on iCloud document storage and employs the same iCloud APIs.

CloudKit storage for managing structured data in iCloud yourself and for sharing data among all of your users.

Relevant Chapters: Designing for Key-Value Data in iCloud , Designing for Documents in iCloud , Designing for Core Data in iCloud , Testing and Debugging (Key-Value and Document Storage) , Designing for CloudKit

See Also

This guide assumes you are already familiar with the software and tools you use to write code. If not, start by reading a number of platform-specific tutorials. Next, read the technology overview documents and then the specific iCloud technology documents.

iOS, tvOS

Mac

To get started . . .

Start Developing iOS Apps Today (Retired)

To learn about other technologies . . .

App Programming Guide for iOS

App Programming Guide for tvOS

Mac App Programming Guide

To learn about iCloud key-value storage

NSUbiquitousKeyValueStore Class Reference

NSUbiquitousKeyValueStore Class Reference

To learn about iCloud document storage

Document-Based App Programming Guide for iOS

Document-Based App Programming Guide for Mac

To learn about Core Data. . .

Core Data Programming Guide

iCloud Programming Guide for Core Data

Core Data Programming Guide

iCloud Programming Guide for Core Data

To learn about CloudKit. . .

CloudKit Quick Start

CloudKit Framework Reference

CloudKit JS Reference

CloudKit Web Services Reference

CloudKit Quick Start

CloudKit Framework Reference

CloudKit JS Reference

CloudKit Web Services Reference

Next

Copyright © 2015 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2015-12-17