<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/PhotosUI/PHContentEditingController/finishContentEditing(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PhotosUI"
    ],
    "preciseIdentifier" : "c:objc(pl)PHContentEditingController(im)finishContentEditingWithCompletionHandler:"
  },
  "title" : "finishContentEditing(completionHandler:)"
}
-->

# finishContentEditing(completionHandler:)

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

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

## Parameters

`completionHandler`

A block for your extension to call when you have finished editing.

    The block takes the following parameter:

- output: The [`PHContentEditingOutput`](/documentation/Photos/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:

1. Disable UI elements to prevent the user from editing further while you complete the remaining steps on a background queue.
2. Create a [`PHContentEditingOutput`](/documentation/Photos/PHContentEditingOutput) object from the [`PHContentEditingInput`](/documentation/Photos/PHContentEditingInput) object that Photos provided to your extension in the [`startContentEditing(with:placeholderImage:)`](/documentation/PhotosUI/PHContentEditingController/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`](/documentation/Photos/PHAdjustmentData) object describing the edits.

> Note:
> To end editing without committing changes to the asset, leave the content editing output’s ``doc://com.apple.photokit/documentation/Photos/PHContentEditingOutput/adjustmentData`` property set to `nil` and do not write to the location specified by its ``doc://com.apple.photokit/documentation/Photos/PHContentEditingOutput/renderedContentURL`` property.

1. Call the `completionHandler` block with your content editing output, to notify Photos that the edit is complete.
2. After the `completionHandler` block finishes executing, you may safely clean up any data or files related to your edit.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)