CloudKit stores and syncs your app's data and shared records in iCloud containers across iOS, macOS, tvOS, watchOS, and visionOS. You model records as CKRecord instances grouped into a CKRecordZone within a CKDatabase, and reach them through a CKContainer that exposes account status via CKAccountStatus. To move data, you run operations such as CKModifyRecordsOperation, CKFetchRecordsOperation, and CKQueryOperation built on CKQuery, attaching large files as CKAsset and tracking incremental changes with a CKServerChangeToken. You collaborate by sharing records through CKShare and its participant operations, and stay current with subscriptions and CKNotification delivery for query, record-zone, and database changes.
Essentials 5
The container, database, and record types that form the foundation of CloudKit storage.
- ClCKContaineriOS 8.0+A conduit to your app's databases.
- ClCKDatabaseiOS 8.0+An object that represents a collection of record zones and subscriptions.
- ClCKRecordiOS 8.0+A collection of key-value pairs that store your app's data.
- ClCKRecordZoneiOS 8.0+A database partition that contains related records.
- ClCKAssetiOS 8.0+An external file that belongs to a record.
Account Status 1
Determine whether the user is signed in to iCloud and able to access the container.
- EnCKAccountStatusiOS 8.0+Constants that indicate the availability of the user's iCloud account.
Queries 2
Build and sort queries that search for records matching specific criteria.
- ClCKQueryiOS 8.0+A query that describes the criteria to apply when searching for records in a database.
- ClCKLocationSortDescriptoriOS 8.0+An object for sorting records that contain location data.
Operations 3
Base operation classes and grouping that drive all asynchronous CloudKit work.
- ClCKOperationiOS 8.0+The abstract base class for all operations that execute in a database.
- ClCKDatabaseOperationiOS 8.0+The abstract base class for operations that act upon databases in CloudKit.
- ClCKOperationGroupiOS 11.0+An explicit association between two or more operations.
Fetching and Modifying Records 5
Operations that read, write, and search records and record zones.
- ClCKFetchRecordsOperationiOS 8.0+An operation for retrieving records from a database.
- ClCKModifyRecordsOperationiOS 8.0+An operation that modifies one or more records.
- ClCKQueryOperationiOS 8.0+An operation for executing queries in a database.
- ClCKFetchRecordZonesOperationiOS 8.0+An operation for retrieving record zones from a database.
- ClCKModifyRecordZonesOperationiOS 8.0+An operation that modifies one or more record zones.
Tracking Changes 4
Operations and tokens that fetch incremental changes to databases, zones, and records.
- ClCKFetchDatabaseChangesOperationiOS 10.0+An operation that fetches database changes.
- ClCKFetchRecordZoneChangesOperationiOS 10.0+An operation that fetches record zone changes.
- ClCKFetchRecordChangesOperationAn operation that reports on the changed and deleted records in the specified record zone.
- ClCKServerChangeTokeniOS 8.0+An opaque token that represents a specific point in a database's history.
Subscriptions 6
Subscription types and operations that notify your app when matching data changes.
- ClCKSubscriptioniOS 8.0+An abstract base class for subscriptions.
- ClCKQuerySubscriptioniOS 10.0+A subscription that generates push notifications when CloudKit modifies records that match a predicate.
- ClCKRecordZoneSubscriptioniOS 10.0+A subscription that generates push notifications when CloudKit modifies records in a specific record zone.
- ClCKDatabaseSubscriptioniOS 10.0+A subscription that generates push notifications when CloudKit modifies records in a database.
- ClCKFetchSubscriptionsOperationiOS 8.0+An operation for fetching subscriptions.
- ClCKModifySubscriptionsOperationiOS 8.0+An operation for modifying one or more subscriptions.
Push Notifications 4
Notification objects that describe the CloudKit changes delivered to your app.
- ClCKNotificationiOS 8.0+The abstract base class for CloudKit notifications.
- ClCKQueryNotificationiOS 8.0+A notification that triggers when a record that matches the subscription's predicate changes.
- ClCKRecordZoneNotificationiOS 8.0+A notification that triggers when the contents of a record zone change.
- ClCKDatabaseNotificationiOS 10.0+A notification that triggers when the contents of a database change.
Sharing 10
Types and operations for sharing records with other users and managing participants.
- ClCKShareiOS 10.0+A specialized record type that manages a collection of shared records.
- ClCKAllowedSharingOptionsiOS 16.0+An object that controls participant access and permission options.
- ClCKAcceptSharesOperationiOS 10.0+An operation that confirms a user's participation in a share.
- ClCKFetchShareMetadataOperationiOS 10.0+An operation that fetches metadata for one or more shares.
- ClCKFetchShareParticipantsOperationiOS 10.0+An operation that converts user identities into share participants.
- ClCKShareRequestAccessOperationiOS 26.0+An operation that requests access to a share on behalf of the current user.
- ClCKSystemSharingUIObserveriOS 16.0+An object the system uses to monitor changes in sharing.
- StCKShareTransferRepresentationA transfer representation the system uses to share an item.
- StCKSharingParticipantAccessOptioniOS 16.0+An object that controls participant access options.
- StCKSharingParticipantPermissionOptioniOS 16.0+An object that controls participant permission options.
User Identity 4
Types and operations that discover and represent the identities of iCloud users.
- ClCKUserIdentityiOS 10.0+The identity of a user.
- ClCKDiscoverUserIdentitiesOperationAn operation that uses the provided criteria to search for discoverable iCloud users.
- ClCKDiscoverAllUserIdentitiesOperationAn operation that uses the device's contacts to search for discoverable iCloud users.
- ClCKFetchWebAuthTokenOperationiOS 9.2+An operation that creates an authentication token for use with CloudKit web services.
Sync Engine 8
The automatic sync engine and the events, reasons, and pending changes that drive it.
- ClCKSyncEngineiOS 17.0+An object that manages the synchronization of local and remote record data.
- PrCKSyncEngineDelegateiOS 17.0+An interface for providing record data to a sync engine and customizing that engine's behavior.
- EnCKSyncEngineSyncReasoniOS 17.0+Describes the reason for a sync operation.
- EnCKSyncEngineEventTypeiOS 17.0+Describes an event that occurs during a sync operation.
- EnCKSyncEngineAccountChangeTypeiOS 17.0+Describes a change to the device's iCloud account.
- EnCKSyncEngineZoneDeletionReasoniOS 17.0+Describes the reason for a record zone deletion.
- EnCKSyncEnginePendingRecordZoneChangeTypeiOS 17.0+A type of change in a record zone that needs to be sent to the server.
- EnCKSyncEnginePendingDatabaseChangeTypeiOS 17.0+Describes the type of a pending database change.
Record Values 4
Protocols and helpers that define and iterate over the key-value contents of records.
- PrCKRecordValueProtocoliOS 8.0+A description of a CloudKit record value.
- PrCKRecordKeyValueSettingiOS 9.0+A protocol for managing the key-value pairs of a CloudKit record.
- Pr__CKRecordObjCValueThe protocol that provides strong type-checking for objects that the CloudKit framework stores on the server.
- StCKRecordKeyValueIteratoriOS 8.0+An iterator of the record's key-value pairs.
Errors 1
The error type that reports failures from CloudKit operations.
- StCKErroriOS 8.0+An error type that describes failures returned by CloudKit operations.
Type Aliases 8
- TyCKContainer_Application_PermissionBlock
- TyCKContainer_Application_PermissionStatus
- TyCKContainer_Application_Permissions
- TyCKRecordValueA data type for objects that CloudKit stores on the server.
- TyCKRecord_Reference_Action
- TyCKShare_Participant_AcceptanceStatus
- TyCKShare_Participant_Permission
- TyCKShare_Participant_Role