jflinter / Dwifft

Swift Diff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SingleSection Calculators don't support changing view after init

danj-stripe opened this issue · comments

I'm upgrading Dwifft to 0.6.3, and had a breakage I didn't expect from the release notes. Our code creates the SingleSectionTableViewDiffCalculator with a dummy UITableView, and then during viewDidLoad it swaps in the "real" table view.

I'm changing our code to eliminate the dummy view, but I think it'd be a good idea to change the public API of the calculators to disallow changing the view, because I've also run into bugs where changing the tableView doesn't invalidate the calculator's state and it subsequently triggers a crash from UIKit (ex: asking the new tableView to delete a row that it's not actually displaying, but the previous tableView was).

It looks like SingleSectionCollectionViewDiffCalculator has the same potential bug.