tonyarnold / Differ

Swift library to generate differences and patches between collections.
https://tonyarnold.github.io/Differ/
MIT License
656 stars 74 forks source link

Completion handlers for UITableView-based animations #65

Open jenox opened 4 years ago

jenox commented 4 years ago

I recently found myself in need of a completion handlers when using Differ to run an animation on UITableView. Differ is still using the beginUpdates()/endUpdates() APIs for UITableView which do not support completion handlers. However, since iOS 11, UITableView too supports performBatchUpdates(_:completion:).

I would love to see an overloaded animateRowChanges and animateRowAndSectionChanges which use the performBatchUpdates API and support a completion handler. We can obviously keep the old methods around to support older OSes. Is this something that you would be interested in having in this project, or is this something you already decided against?

tonyarnold commented 4 years ago

Hi @jenox I accepted #60 recently, which walked this API back out. You can read through the discussion there. To be up front with you, I do very little real-world iOS development these days (my primary development work is on https://revealapp.com/), so I need developers like yourself to point out what's going to be useful (and submit PRs, if you have the time).

What you've proposed sounds reasonable, and I think so long as it's part of a major new release, or gated with availability checks, then using the newer API would be OK.

tonyarnold commented 4 years ago

Actually, wait, #60 has nothing to do with this. Ugh… holiday head.

jenox commented 4 years ago

Sounds like you're open to the suggestion though — I'll try implementing this and will submit a pull request in the near future.