Instance Property

recordID

The unique ID of the record.

Declaration

@NSCopying var recordID: CKRecord.ID { get }

Discussion

The ID of a new record is always set at initialization time. If you use the init(__recordType:recordID:) method to initialize the record, the ID is derived from the CKRecord.ID object you provide. In all other cases, the record generates a UUID and bases its ID on that value. The ID of a record never changes over the lifetime of that record.

When you save a new record object to the server, the server validates the uniqueness of the record but reports an error only if the save policy calls for it. Specifically, it reports an error when the save policy is set to CKModifyRecordsOperation.RecordSavePolicy.ifServerRecordUnchanged, which is the default. For other save policies, the server overwrites the contents of the existing record accordingly.

See Also

Accessing the Record’s Metadata

var creationDate: Date?

The time when the record was first saved to the server.

var creatorUserRecordID: CKRecord.ID?

The ID of the user who created the record.

var modificationDate: Date?

The time when the record was last saved to the server.

var lastModifiedUserRecordID: CKRecord.ID?

The ID of the user who last modified the record.

var recordChangeTag: String?

A string containing the server change token for the record.

class CKRecord.ID

An object that uniquely identifies a record in a database.