---
title: "moveItem(withIdentifier:afterItemWithIdentifier:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdiffabledatasourcesnapshotreference/moveitem(withidentifier:afteritemwithidentifier:)"
---

# moveItem(withIdentifier:afterItemWithIdentifier:)

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

## Declaration

```swift
func moveItem(withIdentifier fromIdentifier: Any, afterItemWithIdentifier toIdentifier: Any)
```

## Parameters

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

## See Also

### Reordering items and sections

- [moveItem(withIdentifier:beforeItemWithIdentifier:)](appkit/nsdiffabledatasourcesnapshotreference/moveitem(withidentifier:beforeitemwithidentifier:).md)
- [moveSection(withIdentifier:afterSectionWithIdentifier:)](appkit/nsdiffabledatasourcesnapshotreference/movesection(withidentifier:aftersectionwithidentifier:).md)
- [moveSection(withIdentifier:beforeSectionWithIdentifier:)](appkit/nsdiffabledatasourcesnapshotreference/movesection(withidentifier:beforesectionwithidentifier:).md)
