Differ icon indicating copy to clipboard operation
Differ copied to clipboard

Completion handlers for UITableView-based animations

Open jenox opened this issue 6 years ago • 3 comments

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?

jenox avatar Dec 27 '19 11:12 jenox

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 avatar Dec 29 '19 04:12 tonyarnold

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

tonyarnold avatar Dec 29 '19 04:12 tonyarnold

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

jenox avatar Dec 29 '19 15:12 jenox