Instance Method

writeImage(toSavedPhotosAlbum:orientation:completionBlock:)

Saves a given image to the Saved Photos album.

Declaration

func writeImage(toSavedPhotosAlbum imageRef: CGImage!, orientation: ALAssetOrientation, completionBlock: ALAssetsLibraryWriteImageCompletionBlock!)

Parameters

imageRef

The image to save to the Saved Photos album.

orientation

The orientation at which to save the image.

completionBlock

The block invoked after the save operation completes.

For a description of the block, see ALAssetsLibraryWriteImageCompletionBlock.

Discussion

If you want to save a UIImage object, you can use the UIImage method CGImage to get a CGImageRef, and cast the image’s imageOrientation to ALAssetOrientation.

See Also

Saving Assets

func writeVideoAtPath(toSavedPhotosAlbum: URL!, completionBlock: ALAssetsLibraryWriteVideoCompletionBlock!)

Saves a video identified by a given URL to the Saved Photos album.

Deprecated
func videoAtPathIs(compatibleWithSavedPhotosAlbum: URL!) -> Bool

Returns a Boolean value that indicates whether a video identified by a given URL is compatible with the Saved Photos album.

Deprecated