<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDiffableDataSourceSnapshotReference/moveItem(withIdentifier:afterItemWithIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDiffableDataSourceSnapshot(im)moveItemWithIdentifier:afterItemWithIdentifier:"
  },
  "title" : "moveItem(withIdentifier:afterItemWithIdentifier:)"
}
-->

# moveItem(withIdentifier:afterItemWithIdentifier:)

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

```
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.

---

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)