code_junkie

Have a reloadData for a UITableView animate when changing

Nov 13th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. CGContextRef context = UIGraphicsGetCurrentContext();
  2. [UIView beginAnimations:nil context:context];
  3. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
  4. [UIView setAnimationDuration:0.5];
  5.  
  6. [self.tableView reloadData];
  7. [UIView commitAnimations];
  8.  
  9. [tableView beginUpdates];
  10. [tableView deleteSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:YES];
  11. [tableView insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:YES];
  12. [tableView endUpdates];
  13.  
  14. UITableViewRowAnimationFade,
  15. UITableViewRowAnimationRight,
  16. UITableViewRowAnimationLeft,
  17. UITableViewRowAnimationTop,
  18. UITableViewRowAnimationBottom,
  19. UITableViewRowAnimationNone,
  20. UITableViewRowAnimationMiddle
  21.  
  22. [_tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
Add Comment
Please, Sign In to add comment