-
-
Save rafaelcrz/13d232d75a8e37e824e06a083327f35d to your computer and use it in GitHub Desktop.
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
CKContainer.default().requestApplicationPermission(.userDiscoverability) { status, error in | |
guard status == .granted, error == nil else { | |
// error handling voodoo | |
return | |
} | |
CKContainer.default().discoverUserIdentity(withUserRecordID: recordID) { identity, error in | |
guard let components = identity?.nameComponents, error == nil else { | |
// more error handling magic | |
return | |
} | |
DispatchQueue.main.async { | |
let fullName = PersonNameComponentsFormatter().string(from: components) | |
print("The user's full name is \(fullName)") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment