Enable iCloud key-value storage, document storage, or CloudKit

iCloud allows you to share user or app data among multiple instances of your app running on different devices. You can choose from three different iCloud services—key-value storage, document storage, and CloudKit—to add to your targets depending on how you want to store and retrieve data. Document storage and CloudKit use containers that you can share with apps developed by the same team.

Note: On macOS 10.11 and later, you can store documents in the user's iCloud Drive folder without needing to set the signing certificate and enable iCloud in the Xcode project. To configure iCloud Drive, read “Enabling Document Storage in iCloud Drive” in iCloud Design Guide.

Enable iCloud

Enable iCloud key-value storage

Key-value storage makes an app's preferences, configuration, or state (stored as key-value pairs) available on all user devices. The container ID for key-value storage is iCloud.[$(TeamIdentifierPrefix)].[$(CFBundleIdentifier)] where the Team ID is a unique string assigned to your team.

Enable iCloud document storage

Document storage makes an app's documents available on all user devices.

Important: Only the Account Holder or Admin role can configure iCloud document storage.

Enable CloudKit

CloudKit stores structured app and user data in iCloud containers that can be shared by all users of an app.

The app owns the public database and can share it with all users of the app. Users own their private database and can share selected records with other users. Apps can use multiple containers and containers can be shared between different apps developed by the same team.

Important: Only the Account Holder or Admin role can configure CloudKit.

See alsoManage iCloud document storage and CloudKit containersManage CloudKit schemas and recordsiCloud Design GuideCloudKit Quick Start