---
title: reorderingHandlers
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionviewdiffabledatasource-9tqpa/reorderinghandlers-swift.property
---

# reorderingHandlers

The diffable data source’s handlers for reordering items.

## Declaration

```swift
@MainActor @preconcurrency var reorderingHandlers: UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.ReorderingHandlers { get set }
```

## Discussion

Discussion Provide reordering handlers to support the reordering of items in your collection view. The system calls the didReorder handler after a reordering transaction (NSDiffableDataSourceTransaction) occurs, so you can update your data backing store with information about the changes. // Allow every item to be reordered dataSource.reorderingHandlers.canReorderItem = { item in return true }

// Option 1: Update the backing store from a CollectionDifference dataSource.reorderingHandlers.didReorder = { [weak self] transaction in     guard let self = self else { return }          if let updatedBackingStore = self.backingStore.applying(transaction.difference) {         self.backingStore = updatedBackingStore     } }

// Option 2: Update the backing store from the final item identifiers dataSource.reorderingHandlers.didReorder = { [weak self] transaction in     guard let self = self else { return }          self.backingStore = transaction.finalSnapshot.itemIdentifiers }

## See Also

### Supporting reordering

- [UICollectionViewDiffableDataSource.ReorderingHandlers](uikit/uicollectionviewdiffabledatasource-9tqpa/reorderinghandlers-swift.struct.md)
- [NSDiffableDataSourceTransaction](uikit/nsdiffabledatasourcetransaction-swift.struct.md)
- [NSDiffableDataSourceSectionTransaction](uikit/nsdiffabledatasourcesectiontransaction-swift.struct.md)
