---
title: "performChanges(_:completionHandler:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phphotolibrary/performchanges(_:completionhandler:)"
---

# performChanges(_:completionHandler:)

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

## Declaration

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

```swift
func performChanges(_ changeBlock: @escaping () -> Void) async throws
```

## 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:

## Mentioned in

Requesting Changes to the Photo Library

## Discussion

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 PHAssetChangeRequest objects and set the contentEditingOutput property on each to an independent PHContentEditingOutput object.

## See Also

### Updating the Library

- [Requesting Changes to the Photo Library](photokit/requesting-changes-to-the-photo-library.md)
- [performChangesAndWait(_:)](photos/phphotolibrary/performchangesandwait(_:).md)
- [PHChangeRequest](photos/phchangerequest.md)
- [PHAssetChangeRequest](photos/phassetchangerequest.md)
- [PHAssetCollectionChangeRequest](photos/phassetcollectionchangerequest.md)
- [PHCollectionListChangeRequest](photos/phcollectionlistchangerequest.md)
- [PHObjectPlaceholder](photos/phobjectplaceholder.md)
