<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHCollectionListChangeRequest/insertChildCollections(_:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHCollectionListChangeRequest(im)insertChildCollections:atIndexes:"
  },
  "title" : "insertChildCollections(_:at:)"
}
-->

# insertChildCollections(_:at:)

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

```
func insertChildCollections(_ collections: any NSFastEnumeration, at indexes: IndexSet)
```

## Parameters

`collections`

An array of [`PHCollection`](/documentation/Photos/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:)`](/documentation/Photos/PHCollectionListChangeRequest/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 <doc://com.apple.documentation/documentation/Foundation/NSMutableArray> method `insert`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)