---
title: "moveSection(_:beforeSection:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nsdiffabledatasourcesnapshot-swift.struct/movesection(_:beforesection:)"
---

# moveSection(_:beforeSection:)

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

## Declaration

```swift
mutating func moveSection(_ identifier: SectionIdentifierType, beforeSection toIdentifier: SectionIdentifierType)
```

## Parameters

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

## See Also

### Reordering items and sections

- [moveItem(_:afterItem:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/moveitem(_:afteritem:).md)
- [moveItem(_:beforeItem:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/moveitem(_:beforeitem:).md)
- [moveSection(_:afterSection:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/movesection(_:aftersection:).md)
