<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "CloudKit"
  },
  "title" : "CloudKit"
}
-->

# CloudKit

Store structured app and user data in iCloud containers that all users of your app can share.

## Overview

The CloudKit framework provides interfaces for moving data between your app and your iCloud containers. You use CloudKit to store your app’s existing data in the cloud so that the user can access it on multiple devices. You can also store data in a public area where all users can access it.

### Using the CloudKit framework

CloudKit isn’t a replacement for your app’s existing data objects. Instead, CloudKit provides complementary services for managing the transfer of data to and from iCloud servers. Because it provides minimal offline caching support, CloudKit relies on the presence of the network and, optionally, a valid iCloud account. A valid iCloud account is only necessary when you want to save data that is specific to a single user. Apps can always store data in a public area that is readable by all users.

Records are at the heart of all data transactions in CloudKit. A record is a dictionary of key-value pairs that represents the data you want to save. You can add new keys and values to records at any time, and you can create links between related records to organize your data. The [`CKRecord`](/documentation/CloudKit/CKRecord) class defines the interfaces for managing the contents of records. CloudKit also relies heavily on the use of <doc://com.apple.documentation/documentation/Foundation/Operation> objects to manage the asynchronous transfer of data to and from the server.

Before using CloudKit, make sure it’s the most suitable option for your app. For more information, see [Deciding whether CloudKit is right for your app](/documentation/CloudKit/deciding-whether-cloudkit-is-right-for-your-app).

> Note:
> The classes of the CloudKit framework aren’t for subclassing. Use these classes as-is to save, retrieve, and manipulate data in iCloud. In addition, many of the protocols of this framework aren’t for adoption by classes outside of CloudKit and UIKit. Each protocol reference document includes information about whether you can adopt the protocol in your own classes.

## Topics

### Essentials

[Deciding whether CloudKit is right for your app](/documentation/CloudKit/deciding-whether-cloudkit-is-right-for-your-app)

Explore the various options you have for using iCloud to store and sync your app’s data.

[Enabling CloudKit in Your App](/documentation/CloudKit/enabling-cloudkit-in-your-app)

Configure your app to store data in iCloud using CloudKit.

### Schemas

[Designing and Creating a CloudKit Database](/documentation/CloudKit/designing-and-creating-a-cloudkit-database)

Create a schema to store your app’s objects as records in iCloud using CloudKit.

[Managing iCloud Containers with CloudKit Database App](/documentation/CloudKit/managing-icloud-containers-with-cloudkit-database-app)

Inspect and modify the schema and data for your app’s iCloud container.

[`CKRecordZone`](/documentation/CloudKit/CKRecordZone)

A database partition that contains related records.

[`CKRecord`](/documentation/CloudKit/CKRecord)

A collection of key-value pairs that store your app’s data.

[`CKRecord.Reference`](/documentation/CloudKit/CKRecord/Reference)

A relationship between two records in a record zone.

[`CKAsset`](/documentation/CloudKit/CKAsset)

An external file that belongs to a record.

[Integrating a Text-Based Schema into Your Workflow](/documentation/CloudKit/integrating-a-text-based-schema-into-your-workflow)

Define and update your schema with the CloudKit Schema Language.

### Records

[Local Records](/documentation/CloudKit/local-records)

Manipulate records on-device and save changes to the server.

[Remote Records](/documentation/CloudKit/remote-records)

Use subscriptions and change tokens to efficiently manage modifications to remote records.

[`CKSyncEngine`](/documentation/CloudKit/CKSyncEngine-5sie5)

An object that manages the synchronization of local and remote record data.

[`CKSyncEngine`](/documentation/CloudKit/CKSyncEngine-4b4w9)

An object that manages the synchronization of local and remote record data.

[Shared Records](/documentation/CloudKit/shared-records)

Share one or more records with other iCloud users.

### User discovery

[`CKUserIdentity`](/documentation/CloudKit/CKUserIdentity)

The identity of a user.

[`CKUserIdentity.LookupInfo`](/documentation/CloudKit/CKUserIdentity/LookupInfo-swift.class)

The criteria to use when searching for discoverable iCloud users.

### Core objects

[`CKContainer`](/documentation/CloudKit/CKContainer)

A conduit to your app’s databases.

[`CKDatabase`](/documentation/CloudKit/CKDatabase)

An object that represents a collection of record zones and subscriptions.

[`CKOperationGroup`](/documentation/CloudKit/CKOperationGroup)

An explicit association between two or more operations.

[`CKRecordValue`](/documentation/CloudKit/CKRecordValue-c.protocol)

The protocol that provides strong type-checking for objects that the CloudKit framework stores on the server.

### Privacy

[Encrypting User Data](/documentation/CloudKit/encrypting-user-data)

Deploy industry-standard security technologies using CloudKit encryption.

[Providing User Access to CloudKit Data](/documentation/CloudKit/providing-user-access-to-cloudkit-data)

Provide users access to the data your app stores on their behalf.

[Changing Access Controls on User Data](/documentation/CloudKit/changing-access-controls-on-user-data)

Restrict access to or remove restrictions from a user’s data at their request.

[`CKFetchWebAuthTokenOperation`](/documentation/CloudKit/CKFetchWebAuthTokenOperation)

An operation that creates an authentication token for use with CloudKit web services.

[Responding to Requests to Delete Data](/documentation/CloudKit/responding-to-requests-to-delete-data)

Provide options for users to delete their CloudKit data from your app.

[Identifying an App’s Containers](/documentation/CloudKit/identifying-an-app-s-containers)

Use Xcode’s Project navigator to find the identifiers of active CloudKit containers.

### Errors

[`CKErrorDomain`](/documentation/CloudKit/CKErrorDomain)

The error domain for CloudKit errors.

[`CKError`](/documentation/CloudKit/CKError)

A type that describes a CloudKit error.

[`CKError.Code`](/documentation/CloudKit/CKError/Code)

The error codes that CloudKit returns.

[`CKErrorRetryAfterKey`](/documentation/CloudKit/CKErrorRetryAfterKey)

The key to retrieve the number of seconds to wait before you retry a request.

[`CKErrorUserDidResetEncryptedDataKey`](/documentation/CloudKit/CKErrorUserDidResetEncryptedDataKey)

The key that determines whether CloudKit deletes a record zone because of a user action.

[`CKPartialErrorsByItemIDKey`](/documentation/CloudKit/CKPartialErrorsByItemIDKey)

The key to retrieve partial errors.

[Record Changed Error Keys](/documentation/CloudKit/record-changed-error-keys)

Constants that represent conflicting records in a save operation.

### Deprecated

[Deprecated Symbols](/documentation/CloudKit/deprecated-symbols)

Review unsupported symbols and their replacements.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)