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

# apply(_:to:animatingDifferences:completion:)

Updates the section UI to reflect the state of the data in the specified snapshot, optionally animating the UI changes and executing a completion handler.

## Declaration

```swift
@MainActor @preconcurrency func apply(_ snapshot: NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>, to section: SectionIdentifierType, animatingDifferences: Bool = true, completion: (() -> Void)? = nil)
```

## See Also

### Updating section data

- [snapshot(for:)](uikit/uicollectionviewdiffabledatasource-9tqpa/snapshot(for:).md)
- [apply(_:to:animatingDifferences:)](uikit/uicollectionviewdiffabledatasource-9tqpa/apply(_:to:animatingdifferences:).md)
