Record Operations

Asynchronously fetch or modify records.


Fetching Records

One of the most common uses of CloudKit is to fetch records from the server to be used locally. If the database that your app is using has one or more record zone it is also useful to fetch the available record zones and/or the changes that exist in a particular record zone.

class CKFetchRecordsOperation

An operation used to retrieve records from CloudKit.

class CKFetchRecordZoneChangesOperation

An operation that fetches record changes across the given record zone.

class CKFetchRecordZonesOperation

An operation used to retrieve zones from a database in CloudKit.

class CKServerChangeToken

An object that identifies a specific version of a record.

Modifying Records

When a record or record zone has been changed locally, those changes need to be persisted back to CloudKit so that they can be shared with other devices and/or users.

class CKModifyRecordsOperation

An operation that saves changes to one or more record objects.

class CKModifyRecordZonesOperation

An operation that saves or deletes record zones.

Fetching Database Changes

In many situations it may be more efficient or useful to fetch all changes that have occurred within a database as opposed to updating records and/or zones individually.

class CKFetchDatabaseChangesOperation

An operation that fetches changes to the database.

Grouping Operation Execution

When it is appropriate, CloudKit operations can be grouped together which assists in aligning operations with user interaction.

class CKOperationGroup

An object that allows CloudKit operations to be grouped to align with user actions.

class CKOperation.Configuration

A collection of properties that describes how a CloudKit operation should behave.

Deprecated Operations

Operations that should no longer be used.

class CKFetchRecordChangesOperation

An operation that reports on the changed and deleted records in the specified record zone.


See Also


class CKRecord

A dictionary of key-value pairs that you use to fetch and save your app's data.

class CKRecordZone

The definition of a custom area for organizing related records in a database.

class CKRecord.Reference

A reference used to create a many-to-one relationship between records in a database.