I have a table view that displays the cell index in a label, so the table view might look something like:
0
1
2
3
4
I want to let the user delete a cell with an animation using:
tbl.deleteRows(at: [IndexPath(row: idx, section: 0)], with: .automatic)
But the problem is, then the other cells don't update their index labels after the animation. So if for example I deleted index 1, then after the delete animation is completed, the table ends up looking like:
0
2
3
4
What's the best way to reload the table view after the delete animation, since deleteRows doesn't have a completion callback?
I'm not interested in just calling tbl.reloadData() in place of tbl.deleteRows(...) since I am interested in the delete animation.
Thanks