I am trying to make a database in which an admin user can create a group which is stored as a group CKRecord type. I want this record to be placed a custom zone that is named after the group name that the admin user decided on. How do I initialize the group private Record to be assigned to that custom zone (without using the deprecated function).
func createGroup(groupName: String){
let groupRecord = CKRecord(recordType: recordTypes.group)
groupRecord[groupRecordType.groupName] = groupName
let share = CKShare(rootRecord: groupRecord)
share.publicPermission = .readWrite
let groupZone = CKRecordZone(zoneName: groupName)
//Need to somehow connect the groupZone to the groupRecord
}
You can use a different CKShare initializer:
The recordZone is part of the CKRecord.ID:
So something more like:
The recordName should be something guaranteed to be unique though - otherwise you can potentially run into problems.