<!--
{
  "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/cancelContentEditing()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PhotosUI"
    ],
    "preciseIdentifier" : "c:objc(pl)PHContentEditingController(im)cancelContentEditing"
  },
  "title" : "cancelContentEditing()"
}
-->

# cancelContentEditing()

Tells your extension to cancel editing.

```
func cancelContentEditing()
```

## Discussion

Photos may call this method at any time after your extension view controller’s view appears, including while your app is preparing the editing output.

At this time, your extension should clean up any resources related to your edit and cancel any background work. If the user cancels editing while your app is preparing output, do not call the `completionHandler` block that Photos provided in the [`finishContentEditing(completionHandler:)`](/documentation/PhotosUI/PHContentEditingController/finishContentEditing(completionHandler:)) method.

---

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)