Vorerst und Single-Sharing Ich mache es wie folgt aus:Gibt es eine Möglichkeit, mehrfache CK-Shares mit einem UICloudSharingController zu erstellen?
//here I have access to record fetched from cloud database
let controller = UICloudSharingController { controller, preparationCompletionHandler in
let share = CKShare(rootRecord: record)
share[CKShareTitleKey] = territory.name as CKRecordValue
share[CKShareTypeKey] = "pl.blueworld.fieldservice" as CKRecordValue
share.publicPermission = .readWrite
let operation = CKModifyRecordsOperation(recordsToSave: [record, share], recordIDsToDelete: nil) //what happens if I pass here a three records and three related ckshares?
operation.savePolicy = .ifServerRecordUnchanged
operation.modifyRecordsCompletionBlock = { records, recordIds, error in
preparationCompletionHandler(share, CloudAssistant.shared.container, error) //how can I do it for every created ckshare?
}
operation.database = territory.database
CloudAssistant.shared.operationQueue.addOperation(operation)
}
controller.delegate = self
controller.popoverPresentationController?.barButtonItem = self.collaborateBarButtonItem
present(controller, animated: true)
Aber wie kann ich dies tun für 2 ckshares? Ist es möglich?
es klingt gut. –