---
title: "moveSection(withIdentifier:beforeSectionWithIdentifier:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nsdiffabledatasourcesnapshotreference/movesection(withidentifier:beforesectionwithidentifier:)"
---

# moveSection(withIdentifier:beforeSectionWithIdentifier:)

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

## Declaration

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

## See Also

### Reordering items and sections

- [moveItem(withIdentifier:afterItemWithIdentifier:)](uikit/nsdiffabledatasourcesnapshotreference/moveitem(withidentifier:afteritemwithidentifier:).md)
- [moveItem(withIdentifier:beforeItemWithIdentifier:)](uikit/nsdiffabledatasourcesnapshotreference/moveitem(withidentifier:beforeitemwithidentifier:).md)
- [moveSection(withIdentifier:afterSectionWithIdentifier:)](uikit/nsdiffabledatasourcesnapshotreference/movesection(withidentifier:aftersectionwithidentifier:).md)
