A container that provides information about and access to the image, video, or Live Photo content of an asset to be edited.
- iOS 8+
- macOS 10.11+
- UIKit for Mac 13.0+Beta
- tvOS 10+
To edit an asset’s photo or video content:
PHAssetobject that represents the photo or video to be edited.
Call the asset’s
requestmethod to retrieve a
Content Editing Input(with: completion Handler:)
Apply your edits to the asset. To allow a user to continue working with the edit later (for example, to adjust the parameters of a photo filter), create a
PHAdjustmentobject describing the changes.
PHContentobject. For photo- or video-only assets, use the editing output’s properties to provide edited asset data. For Live Photo assets, create a
PHLiveobject to edit the Live Photo content.
Photo Editing Context
Use a photo library change block to commit the edit. In the block, create a
PHAssetobject and set its
contentproperty to the editing output that you created. For more details, see
You can also edit assets from photo editing extensions. In this case, instead of working with a
PHAsset object, you implement methods in the
PHContent protocol. Photos provides a
PHContent object when your extension begins editing. When editing is complete, Photos requests a
PHContent object that contains the edited asset content.