insertChildCollections(_:at:)
Inserts the specified collections into the collection list at the specified indexes.
Declaration
func insertChildCollections(_ collections: any NSFastEnumeration, at indexes: IndexSet)Parameters
- collections:
An array of Phcollection objects (asset collections or other collection lists) to be inserted into the collection list.
- indexes:
The indexes at which the collections should be inserted. The count of locations in this index set must equal the count of collections.
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 inserting child collections.
For a detailed discussion of how the index set you specify maps to insertions in the collection list, see the similar NSMutableArray method insert.