---
title: "apply(_:animatingDifferences:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewdiffabledatasource-9tqpa/apply(_:animatingdifferences:)"
---

# apply(_:animatingDifferences:)

Updates the UI to reflect the state of the data in the snapshot, optionally animating the UI changes.

## Declaration

```swift
@MainActor @preconcurrency func apply(_ snapshot: NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>, animatingDifferences: Bool = true) async
```

## See Also

### Updating data

- [snapshot()](uikit/uicollectionviewdiffabledatasource-9tqpa/snapshot().md)
- [apply(_:animatingDifferences:completion:)](uikit/uicollectionviewdiffabledatasource-9tqpa/apply(_:animatingdifferences:completion:).md)
- [applySnapshotUsingReloadData(_:)](uikit/uicollectionviewdiffabledatasource-9tqpa/applysnapshotusingreloaddata(_:).md)
- [applySnapshotUsingReloadData(_:completion:)](uikit/uicollectionviewdiffabledatasource-9tqpa/applysnapshotusingreloaddata(_:completion:).md)
