<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "tvOS: 13.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSDiffableDataSourceSnapshot-swift.struct/insertSections(_:afterSection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit28NSDiffableDataSourceSnapshotV14insertSections_12afterSectionySayxG_xtF"
  },
  "title" : "insertSections(_:afterSection:)"
}
-->

# insertSections(_:afterSection:)

Inserts the provided sections immediately after the section with the specified identifier in the snapshot.

```
mutating func insertSections(_ identifiers: [SectionIdentifierType], afterSection toIdentifier: SectionIdentifierType)
```

## Parameters

`identifiers`

The array of identifiers corresponding to the sections to add to the snapshot.

`toIdentifier`

The identifier of the section after which to insert the new sections.

---

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)