Frustrating fact: After calling tableView:moveRowAtIndexPath:toIndexPath:
, tableView:cellForRowAtIndexPath:
doesn\'t get called for that row.
I do not think it is possible to do a move and a reload at the same time. I've tried several approaches and the best solution I've come up with is to do the reload just before the batch updates. I don't animate reloadRows
because it seems to conflict with the batch update animations.
[tableView reloadRowsAtIndexPaths:indexPathsToReload withRowAnimation:UITableViewRowAnimationNone];
[tableView beginUpdates];
//inserts, deletes and moves here
[tableView endUpdates];
Also, I typically put my cell configuration logic in a separate method like:
- (void)tableView:(UITableView *)tableView configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;
So that I can just call it directly and bypass reloadRowsAtIndexPaths
altogether. You won't get the built in animation this way either, but you can do your own animations.