Skip to content

Instantly share code, notes, and snippets.

@MarcusSmith
Created February 29, 2016 21:20
Show Gist options
  • Save MarcusSmith/e50772cdcc11fa2532f8 to your computer and use it in GitHub Desktop.
Save MarcusSmith/e50772cdcc11fa2532f8 to your computer and use it in GitHub Desktop.
// Get image from an asset
if let asset = record["myImageKey"] as? CKAsset, image = asset.image {
// Do something with the image
}
// Save an image as an asset
do {
let asset = try CKAsset(image: myImage)
record["myImageKey"] = asset
}
catch {
print("Error creating assets", error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment