Clean up TimelineLikeCollectionViewController.apply(_:animatingDifferences:)
This commit is contained in:
parent
c4bf5d406d
commit
4af56e48bf
|
@ -211,11 +211,9 @@ extension TimelineLikeCollectionViewController {
|
||||||
extension TimelineLikeCollectionViewController {
|
extension TimelineLikeCollectionViewController {
|
||||||
// apply(_:animatingDifferences:) is marked as nonisolated, so just awaiting it doesn't dispatch to the main thread, unlike other async @MainActor methods
|
// apply(_:animatingDifferences:) is marked as nonisolated, so just awaiting it doesn't dispatch to the main thread, unlike other async @MainActor methods
|
||||||
// but we always want to update the data source on the main thread for consistency, so this method does that
|
// but we always want to update the data source on the main thread for consistency, so this method does that
|
||||||
|
@MainActor
|
||||||
func apply(_ snapshot: NSDiffableDataSourceSnapshot<Section, Item>, animatingDifferences: Bool) async {
|
func apply(_ snapshot: NSDiffableDataSourceSnapshot<Section, Item>, animatingDifferences: Bool) async {
|
||||||
let task = Task { @MainActor in
|
await self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||||
self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
|
||||||
}
|
|
||||||
await task.value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|
Loading…
Reference in New Issue