Creates a request for modifying the specified asset collection.


convenience init?(for assetCollection: PHAssetCollection)



The asset collection to be modified.

Return Value

An asset collection change request.


After you create a change request within a photo library change block, propose changes to the collection’s title or list of member assets with the properties and instance methods of the change request. After Photos runs your change block, the asset collection reflects your changes. For details on change blocks, see PHPhotoLibrary.

Use this method when modifying an asset collection’s metadata or when adding or removing assets without regard to their arrangement. To work with indexes in the list of member assets, use the init(for:assets:) method instead.

See Also

Modifying Asset Collections

init?(for: PHAssetCollection, assets: PHFetchResult<PHAsset>)

Creates a request for modifying the specified asset collection, with a fetch result for tracking changes.

var title: String

The displayed name of the asset collection.

func addAssets(NSFastEnumeration)

Add the specified assets to the asset collection.

func insertAssets(NSFastEnumeration, at: IndexSet)

Inserts the specified assets into the collection at the specified indexes.

func removeAssets(NSFastEnumeration)

Removes the specified assets from the asset collection.

func removeAssets(at: IndexSet)

Removes the assets at the specified indexes from the asset collection.

func replaceAssets(at: IndexSet, withAssets: NSFastEnumeration)

Replaces the assets at the specified indexes in the asset collection with the specified assets.

func moveAssets(at: IndexSet, to: Int)

Moves the assets at the specified indexes in the asset collection to a new index.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software