recordID
The unique ID of the record.
Declaration
@NSCopying var recordID: CKRecord.ID { get }Discussion
The system sets the ID of a new record at initialization time. If you use the init(recordType:recordID:) method to initialize the record, the ID derives 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 during its lifetime.
When you save a new record object to the server, the server validates the uniqueness of the record, but returns an error only if the save policy calls for it. Specifically, it returns an error when the save policy is CKModifyRecordsOperation.RecordSavePolicy.ifServerRecordUnchanged, which is the default. For all other save policies, the server overwrites the contents of the existing record.