<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHPhotoLibrary/performChanges(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHPhotoLibrary(im)performChanges:completionHandler:"
  },
  "title" : "performChanges(_:completionHandler:)"
}
-->

# performChanges(_:completionHandler:)

Asynchronously runs a block that requests changes to the photo library.

```
func performChanges(_ changeBlock: @escaping () -> Void, completionHandler: (@Sendable (Bool, (any Error)?) -> Void)? = nil)
```

## Parameters

`changeBlock`

A block that requests changes to perform.

    This block takes no parameters and has no return value.

`completionHandler`

A block that Photos calls after the change block completes and Photos performs the requested changes.

    The block takes the following parameters:

- success: `true` if Photos successfully applied the changes requested in the block; otherwise, `false`.
- error: If an error occurs, an `NSError` object describing the error; otherwise, `nil`.

## Discussion

Photos executes both the change block and the completion handler block on an arbitrary serial queue. To update your app’s UI as a result of a change, dispatch that work to the main queue.

> Note:
> For each call to this method, iOS shows an alert asking the user for permission to edit the contents of the photo library. If your app needs to submit several changes at once, combine them into a single change block. For example, to edit the content of multiple existing photos, create multiple ``doc://com.apple.photokit/documentation/Photos/PHAssetChangeRequest`` objects and set the ``doc://com.apple.photokit/documentation/Photos/PHAssetChangeRequest/contentEditingOutput`` property on each to an independent ``doc://com.apple.photokit/documentation/Photos/PHContentEditingOutput`` object.

---

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)