---
title: "finishContentEditing(completionHandler:)"
framework: photosui
role: symbol
role_heading: Instance Method
path: "photosui/phcontenteditingcontroller/finishcontentediting(completionhandler:)"
---

# finishContentEditing(completionHandler:)

Asks your extension for edited asset data to finish the editing session.

## Declaration

```swift
func finishContentEditing(completionHandler: @escaping (PHContentEditingOutput?) -> Void)
```

```swift
func finishContentEditing() async -> PHContentEditingOutput?
```

## Parameters

- `completionHandler`: A block for your extension to call when you have finished editing. The block takes the following parameter:

## Discussion

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. note: To end editing without committing changes to the asset, leave the content editing output’s adjustmentData property set to nil and do not write to the location specified by its renderedContentURL property. Call the completionHandler block with your content editing output, to notify Photos that the edit is complete. After the completionHandler block finishes executing, you may safely clean up any data or files related to your edit.

## See Also

### Performing an Edit

- [startContentEditing(with:placeholderImage:)](photosui/phcontenteditingcontroller/startcontentediting(with:placeholderimage:).md)
