video of the tableview animation bug
I have a table view which expands/collapse its cells.
As of iOS 11, the tableView starts to behave strangely on insertio
In iOS 11.2, I had a bad animation after deleting a row using the standard row actions. I was only able to improve the situation by wrapping the row delete and row action dismissal in a CATransaction.
I dismiss the row actions first and wait for that animation to complete before deleting the row from the table view.
It at least doesn't jump around the table views content offset anymore, but is a lengthy two step animation. I'm still looking for a better solution.
CATransaction.begin()
CATransaction.setCompletionBlock({
self.tableView.beginUpdates()
self.myViewModel?.items?.remove(at: indexPath.row)
self.tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.top)
self.tableView.endUpdates()
})
self.tableView.setEditing(false, animated: true)
CATransaction.commit()