Skip to content

Commit

Permalink
Use animator() proxy for NSCollectionView animations (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
rudedogg authored and tonyarnold committed Apr 19, 2018
1 parent c761986 commit 30d9b35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Differ/Diff+AppKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public extension NSCollectionView {
completion: ((Bool) -> Swift.Void)? = nil,
indexPathTransform: @escaping (IndexPath) -> IndexPath = { $0 }
) {
performBatchUpdates({
self.animator()
.performBatchUpdates({
let update = BatchUpdate(diff: diff, indexPathTransform: indexPathTransform)
self.deleteItems(at: Set(update.deletions))
self.insertItems(at: Set(update.insertions))
Expand Down Expand Up @@ -270,7 +271,8 @@ public extension NSCollectionView {
sectionTransform: @escaping (Int) -> Int = { $0 },
completion: ((Bool) -> Void)? = nil
) {
performBatchUpdates({
self.animator()
.performBatchUpdates({
let update = NestedBatchUpdate(diff: diff, indexPathTransform: indexPathTransform, sectionTransform: sectionTransform)
self.insertSections(update.sectionInsertions)
self.deleteSections(update.sectionDeletions)
Expand Down

0 comments on commit 30d9b35

Please sign in to comment.