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

# moveSection(withIdentifier:beforeSectionWithIdentifier:)

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

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

## Parameters

`fromSectionIdentifier`

The identifier of the section to move in the snapshot.

`toSectionIdentifier`

The identifier of the section before 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)