Type Method

creationRequestForAssetFromImage(atFileURL:)

Creates a request for adding a new image asset to the Photos library, using the image file at the specified URL.

Declaration

class func creationRequestForAssetFromImage(atFileURL fileURL: URL) -> Self?

Parameters

fileURL

A URL for an image file.

Return Value

An asset creation request.

Discussion

Call this method within a photo library change block to create a new asset. For details on change blocks, see PHPhotoLibrary.

To set metadata properties of the newly created asset, use the corresponding properties of the change request (listed in Modifying Assets). To reference the newly created asset later in the same change block or after the change block completes, use the placeholderForCreatedAsset property to retrieve a placeholder object.

See Also

Adding New Assets

class func creationRequestForAsset(from: UIImage) -> Self

Creates a request for adding a new image asset to the Photos library.

class func creationRequestForAssetFromVideo(atFileURL: URL) -> Self?

Creates a request for adding a new video asset to the Photos library, using the video file at the specified URL.

var placeholderForCreatedAsset: PHObjectPlaceholder?

A placeholder object for the asset that the change request creates.