---
title: Requesting Changes to the Photo Library
framework: photokit
role: article
path: photokit/requesting-changes-to-the-photo-library
---

# Requesting Changes to the Photo Library

## Requesting Changes to the Photo Library

Requesting Changes to the Photo Library Create, delete, or modify assets and collections in a photo library by making change requests.

Overview

Because [PHAsset](/documentation/photos/phasset), [PHAssetCollection](/documentation/photos/phassetcollection), and [PHCollectionList](/documentation/photos/phcollectionlist) instances are immutable objects, you can’t make changes to them. To modify the Photos assets or collections these objects represent, use the shared photo library to execute a change block. Inside the change block, create change request objects. Then apply a change block with one of the methods listed in Updating the Library. The changes you request take effect after Photos runs the change block and calls your completion handler.

Each of the change request classes—[PHAssetChangeRequest](/documentation/photos/phassetchangerequest), [PHAssetCollectionChangeRequest](/documentation/photos/phassetcollectionchangerequest), and [PHCollectionListChangeRequest](/documentation/photos/phcollectionlistchangerequest)—corresponds to an asset or collection class. Use these classes to make the following types of changes:

Creating items. Each change request class provides methods for requesting to create a new item of the corresponding asset or collection class. For example, use the [creationRequestForAssetCollection(withTitle:)](/documentation/photos/phassetcollectionchangerequest/creationrequestforassetcollection(withtitle:)) method to create an asset collection.

To reference a newly created request within the change block—for example, to add a new asset to a collection—use the [PHObjectPlaceholder](/documentation/photos/phobjectplaceholder) object provided by the change request. After the change block completes, use the placeholder object’s [localIdentifier](/documentation/photos/phobject/localidentifier) property to fetch the created object.

Deleting items. Each change request class provides methods for requesting to delete one or more items of the corresponding asset or collection class. For example, use the [deleteCollectionLists(_:)](/documentation/photos/phcollectionlistchangerequest/deletecollectionlists(_:)) method to delete collection lists.

Modifying items. You modify an existing asset or collection by creating a change request from a [PHAsset](/documentation/photos/phasset), [PHAssetCollection](/documentation/photos/phassetcollection), or [PHCollectionList](/documentation/photos/phcollectionlist) object representing it. For example, the [init(for:)](/documentation/photos/phassetchangerequest/init(for:)) method creates a change request you can use for modifying an asset.

After creating a change request, use its properties and instance methods to modify the corresponding features of the asset or collection it represents. For example, to set an asset’s [isFavorite](/documentation/photos/phasset/isfavorite) property, set the [isFavorite](/documentation/photos/phassetchangerequest/isfavorite) property of a change request created from that asset. To add to an asset collection, call the [addAssets(_:)](/documentation/photos/phassetcollectionchangerequest/addassets(_:)) method on an asset collection change request.
