Instance Property


A reference to the parent record to this record.


@NSCopying var parent: CKRecord.Reference? { get set }


A parent reference is used to teach CloudKit about the hierarchy of your records. This hierarchy of records will be shared if the share reference is set on a record.

A parent record reference must have a CKRecord_Reference_Action.none set.

The target of a parent reference must exist at save time — either already on the server, or part of the same CKModifyRecordsOperation batch.

You are encouraged to set up the parent relationships as part of normal record saves, even if you are not planning on sharing records at this time. This allows you to share and stop sharing a hierarchy of records at a later date by only modifying the “top level” record, setting or clear its share reference.

See Also

Sharing Records

var share: CKRecord.Reference?

A reference to the share associated with the sharing of this record.

func setParent(CKRecord?)

Creates and sets a reference object for a parent from its record.

func setParent(CKRecord.ID?)

Creates and sets a reference object for a parent from the parent’s record ID.