finishContentEditing(completionHandler:)
Asks your extension for edited asset data to finish the editing session.
Declaration
func finishContentEditing(completionHandler: @escaping (PHContentEditingOutput?) -> Void)func finishContentEditing() async -> PHContentEditingOutput?Parameters
- completionHandler:
A block for your extension to call when you have finished editing.
The block takes the following parameter:
- output
The Phcontenteditingoutput object you created and populated before calling the completion handler.
Discussion
Photos calls this method when the user chooses to end the editing session. Your extension view controller should:
Disable UI elements to prevent the user from editing further while you complete the remaining steps on a background queue.
Create a PHContentEditingOutput object from the PHContentEditingInput object that Photos provided to your extension in the startContentEditing(with:placeholderImage:) method.
Use the content editing output to store the rendered photo or video data from the user’s edits and a PHAdjustmentData object describing the edits.
Call the
completionHandlerblock with your content editing output, to notify Photos that the edit is complete.After the
completionHandlerblock finishes executing, you may safely clean up any data or files related to your edit.