Skip to content

Commit 30d9b35

Browse files
rudedoggtonyarnold
authored andcommitted
Use animator() proxy for NSCollectionView animations (#27)
1 parent c761986 commit 30d9b35

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Sources/Differ/Diff+AppKit.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public extension NSCollectionView {
138138
completion: ((Bool) -> Swift.Void)? = nil,
139139
indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 }
140140
) {
141-
performBatchUpdates({
141+
self.animator()
142+
.performBatchUpdates({
142143
let update = BatchUpdate(diff: diff, indexPathTransform: indexPathTransform)
143144
self.deleteItems(at: Set(update.deletions))
144145
self.insertItems(at: Set(update.insertions))
@@ -270,7 +271,8 @@ public extension NSCollectionView {
270271
sectionTransform: @escaping (Int) -> Int = { $0 },
271272
completion: ((Bool) -> Void)? = nil
272273
) {
273-
performBatchUpdates({
274+
self.animator()
275+
.performBatchUpdates({
274276
let update = NestedBatchUpdate(diff: diff, indexPathTransform: indexPathTransform, sectionTransform: sectionTransform)
275277
self.insertSections(update.sectionInsertions)
276278
self.deleteSections(update.sectionDeletions)

0 commit comments

Comments
 (0)