init(livePhotoEditingInput:)
Creates a Live Photo editing context for the specified editing input.
Declaration
init?(livePhotoEditingInput livePhotoInput: PHContentEditingInput)Parameters
- livePhotoInput:
A content editing input object representing the Live Photo for which to perform editing.
Return Value
A new Live Photo editing context, or nil if the provided content editing input does not represent a Live Photo.
Discussion
In an app using the Photos framework, you obtain a PHContentEditingInput object by calling requestContentEditingInput(with:completionHandler:) method of a PHAsset object that you’ve previously fetched.
In a photo editing extension that runs within the Photos app, your extension’s main view controller (which adopts the PHContentEditingController protocol) receives a PHContentEditingInput object when the user chooses to edit a Live Photo with your extension.
You can create a Live Photo editing context only from PHContentEditingInput object that represents a Live Photo. Use the livePhoto property of the editing input to verify that it has live Photo content.