From cf82d2a677c1aef23312622edd794b65f9656716 Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Wed, 8 Sep 2021 04:16:48 +1200 Subject: [PATCH] Ditch CATransaction for UIKit api --- .../Datasource/ASDiffableDataSourceCollectionView.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Sources/ASCollectionView/Datasource/ASDiffableDataSourceCollectionView.swift b/Sources/ASCollectionView/Datasource/ASDiffableDataSourceCollectionView.swift index 00b6f1a..0d9335b 100644 --- a/Sources/ASCollectionView/Datasource/ASDiffableDataSourceCollectionView.swift +++ b/Sources/ASCollectionView/Datasource/ASDiffableDataSourceCollectionView.swift @@ -40,18 +40,15 @@ class ASDiffableDataSourceCollectionView: ASDiffableDataSou self.currentSnapshot = .init(sections: newSections) } } - CATransaction.begin() - CATransaction.setCompletionBlock(completion) if firstLoad || !animated { - CATransaction.setDisableActions(true) - apply() + UIView.performWithoutAnimation(apply) } else { apply() } - CATransaction.commit() + completion?() firstLoad = false }