One barrier to using IGLK is adopting the SectionController + ListAdapter architecture, which is difficult for legacy projects, or projects that have adopted other "list" abstractions but now want to implement diffing for those lists.
Currently, we provide a Diffing subspec, but this requires clients to write bindings to UICollectionView and UITableView themselves. IGLK should provide this instead.
Provide extension methods on UITableView and UICollectionView that will perform updates on the view given the results from the IGListDiff C functions. Essentially, we want to expose the functionality of IGListAdapterUpdater in way that allows clients to perform updates without using SectionControllers and ListAdapters.
let old = //...
let new = //....
let diffResults = ListDiff(oldArray:old newArray:new option:IGListDiffEquality)
collectionView.performBatchUpdates(diffResults: diffResults, completion: {
// completion block
})
// table view follows similarly
So on board with this. Will be trivial.
@jessesquires what do you think about creating a "light" adapter that does:
numberOfItemsIGListBindable cells, automatically binds view modelsThis would solve our UITableView issue without refactoring the world (I still think full table support will open a world of hurt).
Maybe we solve "apply diff update" category first then this?
Sounds reasonable to my ears, @rnystrom :)
@rnystrom -- 馃挴 yeah, let's do the simpler, "least intrusive" solution first
Most helpful comment
@rnystrom -- 馃挴 yeah, let's do the simpler, "least intrusive" solution first