0

Is such a thing possible?

Basically the data source for my UITableView is a binary tree. I'm going to remove the children of one of the nodes in the tree, and I want the table view to automatically animate the update, which will remove the rows corresponding to these children.

I know I can use beginUpdates(), deleteRowsAtIndexPaths() and endUpdates() but finding all those rows is a computational annoyance (it's far from negligible). Is there any way for the UITableView to just reload with an animation?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
  • No. `UITableView` has not enough information to do the animation after reloaded. That's why you need to call those methods in order to do so. – tia Jul 05 '15 at 15:44

1 Answers1

0

This answer https://stackoverflow.com/a/13261683/1077601 suggests you can put your [self.tableView reloadData]; inside a UIView animation block.

Community
  • 1
  • 1
Darren
  • 10,182
  • 20
  • 95
  • 162