Search code examples
ioscloudkitapple-id

Check ownership of record in public CloudKit database


I've just began working with CloudKit and planning to store data in a public CloudKit database. One feature I need is to display information about who has created a record and also let that owner to modify or delete their own records.

None of the tutorials I've read so far talk about this.

How is this done?


Solution

  • Just get that from the CKRecord like this:

    record.recordID
    record.recordType
    record.creationDate
    record.creatorUserRecordID
    record.modificationDate
    record.lastModifiedUserRecordID
    record.recordChangeTag
    

    The rights for the user (public, authenticated, owner) who can create / update / delete a record can be setup in the CloudKit dashboard