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

# moveSection(withIdentifier:afterSectionWithIdentifier:)

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

```
func moveSection(withIdentifier fromSectionIdentifier: Any, afterSectionWithIdentifier toSectionIdentifier: Any)
```

## Parameters

`fromSectionIdentifier`

The identifier of the section to move in the snapshot.

`toSectionIdentifier`

The identifier of the section after which to move the specified section.

---

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)