---
title: "insertItems(withIdentifiers:beforeItemWithIdentifier:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdiffabledatasourcesnapshotreference/insertitems(withidentifiers:beforeitemwithidentifier:)"
---

# insertItems(withIdentifiers:beforeItemWithIdentifier:)

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

## Declaration

```swift
func insertItems(withIdentifiers identifiers: [Any], beforeItemWithIdentifier itemIdentifier: Any)
```

## Parameters

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

## See Also

### Inserting items and sections

- [insertItems(withIdentifiers:afterItemWithIdentifier:)](appkit/nsdiffabledatasourcesnapshotreference/insertitems(withidentifiers:afteritemwithidentifier:).md)
- [insertSections(withIdentifiers:afterSectionWithIdentifier:)](appkit/nsdiffabledatasourcesnapshotreference/insertsections(withidentifiers:aftersectionwithidentifier:).md)
- [insertSections(withIdentifiers:beforeSectionWithIdentifier:)](appkit/nsdiffabledatasourcesnapshotreference/insertsections(withidentifiers:beforesectionwithidentifier:).md)
