while presenting the UICloudSharingController on top of a view, it presents the screen and when I select the messages option to send a message to a person whom I want to share with, it gives a spinning wheel with "uploading" message and vanishes.
However when I go to cloudkit dashboard the root record has been shared. But I cannot share it with specific person. Is it because it has shared global? How can I fix it?
However when I go to cloudkit dashboard the root record has been shared. But I cannot share it with specific person. Is it because it has shared global? How can I fix it?
Code Block self.shareInfraRecord(zoneID: appDelegate.privateContactZoneID, completion: { (status) in if ( status == false) { return } }) func shareInfraRecord(zoneID: CKRecordZone.ID, completion: @escaping(Bool) -> Void) { if let rootRecord = self.rootRecord { if self.rootRecord?.share == nil { let sharingController = UICloudSharingController { (controller, preparationHandler: @escaping (CKShare?, CKContainer?, Error?) -> Void) in let shareID = CKRecord.ID(recordName: UUID().uuidString, zoneID: zoneID) var share = CKShare(rootRecord: rootRecord, shareID: shareID) share[CKShare.SystemFieldKey.title] = Cloud.ShareInfrastructure.ContactShareTitleKey as CKRecordValue? share[CKShare.SystemFieldKey.shareType] = Cloud.ShareInfrastructure.ContactShareTypeKey as CKRecordValue? let modifyRecZoneOp = CKModifyRecordsOperation(recordsToSave:[rootRecord, share], recordIDsToDelete: nil) modifyRecZoneOp.modifyRecordsCompletionBlock = { (records, recordID, error) in if error != nil { if let ckerror = error as? CKError { if let serverVersion = ckerror.serverRecord as? CKShare { share = serverVersion } completion(false) } } preparationHandler(share, self.defaultContainer, error) } self.privateDB?.add(modifyRecZoneOp) }