Contents

replaceChildCollections(at:withChildCollections:)

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

Declaration

func replaceChildCollections(at indexes: IndexSet, withChildCollections collections: any NSFastEnumeration)

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 init(for:childCollections:) method before rearranging child collections.

See Also

Managing Collections