Contents

init(for:)

Creates a request for modifying the specified asset.

Declaration

convenience init(for asset: PHAsset)

Parameters

  • asset:

    The asset to be modified.

Mentioned in

Return Value

An asset change request.

Discussion

Before editing an asset, use its canPerform(_:) method to see if the asset allows editing.

After you create a change request within a photo library change block, propose changes to the original asset’s properties by setting the corresponding properties of the change request. After Photos runs your change block, the asset’s properties reflect your changes. For details on change blocks, see PHPhotoLibrary.

To edit an asset’s image or video content, first begin a content editing session with the asset’s requestContentEditingInput(with:completionHandler:) method. You commit a content edit by setting the contentEditingOutput property of a change request within a change block. For more information about asset content editing, see PHAsset.

See Also

Modifying Assets