---
title: "moveItem(_:beforeItem:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdiffabledatasourcesnapshot-swift.struct/moveitem(_:beforeitem:)"
---

# moveItem(_:beforeItem:)

Moves the item from its current position in the snapshot to the position immediately before the specified item.

## Declaration

```swift
mutating func moveItem(_ identifier: ItemIdentifierType, beforeItem toIdentifier: ItemIdentifierType)
```

## Parameters

- `identifier`: The identifier of the item to move in the snapshot.
- `toIdentifier`: The identifier of the item before which to move the specified item.

## See Also

### Reordering Items and Sections

- [moveItem(_:afterItem:)](appkit/nsdiffabledatasourcesnapshot-swift.struct/moveitem(_:afteritem:).md)
- [moveSection(_:afterSection:)](appkit/nsdiffabledatasourcesnapshot-swift.struct/movesection(_:aftersection:).md)
- [moveSection(_:beforeSection:)](appkit/nsdiffabledatasourcesnapshot-swift.struct/movesection(_:beforesection:).md)
