Last active
September 7, 2022 09:51
-
-
Save marcelofabri/0a722c477ec245d6fc3e to your computer and use it in GitHub Desktop.
CloudKit User Info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let container = CKContainer.defaultContainer() | |
container.fetchUserRecordIDWithCompletionHandler { (recordID, error) in | |
if !error { | |
println(recordID.recordName) | |
container.requestApplicationPermission(.PermissionUserDiscoverability) { (status, permissionError) in | |
if status == CKApplicationPermissionStatus.Granted { | |
container.discoverUserInfoWithUserRecordID(recordID) { (info, fetchError) in | |
println("\(info.firstName) \(info.lastName)") | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment