Instance Method

replaceChildCollectionsAtIndexes:withChildCollections:

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

Declaration

- (void)replaceChildCollectionsAtIndexes:(NSIndexSet *)indexes withChildCollections:(id<NSFastEnumeration>)collections;

Parameters

indexes

The indexes of the child collections to be replaced in the collection list.

collections

An array of PHCollection objects (asset collections or other collection lists) to be inserted into (or moved within) the collection list.

Discussion

To ensure that the index set you specify is valid even if the collection list has changed since you fetched it, create a change request with a snapshot of the collection list’s contents using the changeRequestForCollectionList:childCollections: method before rearranging child collections.

See Also

Modifying Collection Lists

+ changeRequestForCollectionList:

Creates a request for modifying the specified collection list.

+ changeRequestForCollectionList:childCollections:

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

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.

- moveChildCollectionsAtIndexes:toIndex:

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