Type Method

changeRequestForCollectionList:childCollections:

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

Declaration

+ (instancetype)changeRequestForCollectionList:(PHCollectionList *)collectionList childCollections:(PHFetchResult<__kindof PHCollection *> *)childCollections;

Parameters

collectionList

The collection list to be modified.

childCollections

A fetch result listing the child collections in the collection.

Return Value

A collection list change request.

Discussion

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

Use this method when you need to insert, remove, or rearrange collections at specified indexes in the collection list. By passing in a fetch result reflecting what your app sees as the current state of the collection’s membership, the Photos framework can ensure that the indexes you specify are valid even if the collection has changed since you last fetched it. If you don’t need to work with indexes in the list of child collections, you can use the changeRequestForCollectionList: method instead.

See Also

Modifying Collection Lists

+ changeRequestForCollectionList:

Creates a request for modifying the specified collection list.

title

The displayed name of the collection list.

- addChildCollections:

Add the specified collections as children of the collection list.

- insertChildCollections:atIndexes:

Inserts the specified collections into the collection list at the specified indexes.

- removeChildCollections:

Removes the specified child collections from the collection list.

- removeChildCollectionsAtIndexes:

Removes the child collections at the specified indexes from the collection list.

- replaceChildCollectionsAtIndexes:withChildCollections:

Replaces the child collections at the specified indexes in the collection list with the specified collections.

- moveChildCollectionsAtIndexes:toIndex:

Moves the child collections at the specified indexes in the collection list to a new index.