Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animated reloadData on UITableView

How would you anime - reloadData on UITableView? Data source is on UIFetchedResultsController so I can't play with – insertSections:withRowAnimation:, – deleteSections:withRowAnimation: wrapped in – beginUpdates, – endUpdates.

EDIT: I want to call - reloadData after NSFetchedResultsController refetch.

like image 614
user500 Avatar asked Sep 25 '11 19:09

user500


1 Answers

I did category method.

- (void)reloadData:(BOOL)animated {     [self reloadData];      if (animated) {          CATransition *animation = [CATransition animation];         [animation setType:kCATransitionPush];         [animation setSubtype:kCATransitionFromBottom];         [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];         [animation setFillMode:kCAFillModeBoth];         [animation setDuration:.3];         [[self layer] addAnimation:animation forKey:@"UITableViewReloadDataAnimationKey"];      } } 
like image 110
user500 Avatar answered Sep 23 '22 00:09

user500