---
title: "insertItems(_:beforeItem:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nsdiffabledatasourcesnapshot-swift.struct/insertitems(_:beforeitem:)"
---

# insertItems(_:beforeItem:)

Inserts the provided items immediately before the item with the specified identifier in the snapshot.

## Declaration

```swift
mutating func insertItems(_ identifiers: [ItemIdentifierType], beforeItem beforeIdentifier: ItemIdentifierType)
```

## Parameters

- `identifiers`: The array of identifiers corresponding to the items to add to the snapshot.
- `beforeIdentifier`: The identifier of the item before which to insert the new items.

## See Also

### Inserting items and sections

- [insertItems(_:afterItem:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/insertitems(_:afteritem:).md)
- [insertSections(_:afterSection:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/insertsections(_:aftersection:).md)
- [insertSections(_:beforeSection:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/insertsections(_:beforesection:).md)
