osteslag / Changeset

Minimal edits from one collection to another
MIT License
802 stars 46 forks source link

Embed UIKit Extensions #29

Closed osteslag closed 7 years ago

osteslag commented 7 years ago

Move the two UIKit extensions (for UITableView and UICollectionView respectively) from the Test App target to the framework. Only compiles for iOS. Provides these two methods:

// UITableView
open func update<T: Equatable>(with edits: [Edit<T>], in section: Int = 0)

// UICollectionView
open func update<T: Equatable>(with edits: [Edit<T>], in section: Int = 0, completion: ((Bool) -> Void)? = nil)

In most cases (I’ll argue), you can then just call like this:

tableView.update(with: changeset.edits)
osteslag commented 7 years ago

Closes #20.