Created
March 5, 2017 21:38
-
-
Save insidegui/8c960b15f65aa123fe9e20fe2ee07226 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private func updateUserRecord(_ userRecord: CKRecord, with avatarURL: URL) { | |
userRecord["avatar"] = CKAsset(fileURL: avatarURL) | |
CKContainer.default().publicCloudDatabase.save(userRecord) { _, error in | |
guard error == nil else { | |
// top-notch error handling | |
return | |
} | |
print("Successfully updated user record with new avatar") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment