I have a very frustrating issue. I have an app with a UITableView. When I am removing a cell from the table view, it is removed from the data model and then I call the following:
-(void)removeItem:(NSIndexPath *)indexPath {
[self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:@[indexPath]
withRowAnimation:UITableViewRowAnimationRight];
[self.tableView endUpdates];
}
My problem is, I've tried it like I do above, and I've tried without using animateWithDuration. I've even tried with a CATransaction, but however I do it, the animation doesn't happen.
I've got slow animations on in my Simulator and when I remove an item from the list, it removes correctly, but without animation. It just disappears and leaves a blank space for a moment before the table view data is reloaded.
I've search all over SO and Google and I can't seem to find an answer. Any ideas?
Does it perhaps have to do with the fact that I'm removing the object from the data model before calling the function above?
Edit: Removed the Animation Block as it is incorrect