Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload Table Animation

So when a user taps on a cell in my table I don't actually push to a new view controller I just reload the data inside of that tableView.

However, I want to get an effect simular to what it would look like if I did push a new view controller.

Does anybody know how I can slide old content off old content off the screen and new content onto the screen for an entire table?

like image 252
endy Avatar asked Dec 26 '11 13:12

endy


1 Answers

Depending on how many sections you have you can use - (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation

So you could do something like this:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    [tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0,[self numberOfSectionsInTableView])] withRowAnimation:UITableViewRowAnimationRight];
}
like image 134
DanZimm Avatar answered Sep 21 '22 20:09

DanZimm