0
votes

I'm currently experimenting with animations for UITableViewCell. So far everything is working fine, except for one 'issue'.

When I scroll through my UITableView a nice animation is displayed for the cells that are coming in. However when I tap one cell, the tableview reloads ([self.tableView reloadData]) and the animation is displayed again for all visible cells.

How can I force my tableview to only show the animation on cells that are coming in?

I'm using the UITableViewController function:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {}

Anyone has suggestions on this?

1

1 Answers

1
votes

You probably shouldn't be calling dataReload on tableView but only

[myUITableView reloadRowsAtIndexPaths:rowsToReload withRowAnimation:UITableViewRowAnimationNone];

to reload only cells that need it.

however if you animate them in tableview willDisplayCell you could ask whether that cell is currently visible and animate it only if it isn't.