Instance Property

savePolicy

The policy to apply when the server contains a newer version of a specific record.

Declaration

var savePolicy: CKModifyRecordsOperation.RecordSavePolicy { get set }

Discussion

Each record has a change tag that allows the server to track when that record was saved. When you save a record, CloudKit compares the change tag in your local copy of the record with the one on the server. If the two tags do not match—meaning that there is a potential conflict—the server uses the value in this property to determine how to proceed.

The default value of this property is CKModifyRecordsOperation.RecordSavePolicy.ifServerRecordUnchanged. If you intend to change the value of this property, do so before executing the operation or submitting the operation object to a queue.

See Also

Configuring the Operation Object

var recordsToSave: [CKRecord]?

The records to save to the database.

var recordIDsToDelete: [CKRecord.ID]?

The IDs of the records to delete permanently from the database.

var clientChangeTokenData: Data?

A data token used to track client-side changes to records.

var isAtomic: Bool

A Boolean value indicating whether the entire operation fails when one or more records in the same zone cannot be written.