So I have a UITableView
with many sections, each section contains items with a certain letter of the alphabet(Alphabetically sorted). The user has the ability to add more data to this table, so when they add a new item that goes in a section that is not there, a new section must be created. Same problem when deleting, if the last item in a section is deleted the whole section would be removed. How would I animate this?
I have found something similar to this: UITableview reloaddata with animation
But that does not help me. It recommends using this method(In swift):
[_tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
This works great if you have the same number of sections before and after the reload, but mine does not. The number of sections could change causing a crash.