Skip to content

Instantly share code, notes, and snippets.

@MarcusSmith
Last active February 29, 2016 21:14
Show Gist options
  • Save MarcusSmith/e73cefe12b6bd4edd548 to your computer and use it in GitHub Desktop.
Save MarcusSmith/e73cefe12b6bd4edd548 to your computer and use it in GitHub Desktop.
do {
let data = UIImagePNGRepresentation(myImage)!
try data.writeToURL(tempURL, options: NSDataWritingOptions.AtomicWrite)
let asset = CKAsset(fileURL: tempURL)
record["myImageKey"] = asset
}
catch {
print("Error writing data", error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment