Have a reloadData for a UITableView animate when changing
Posted
by Chris Butler
on Stack Overflow
See other posts from Stack Overflow
or by Chris Butler
Published on 2009-01-07T07:25:26Z
Indexed on
2010/04/29
3:57 UTC
Read the original article
Hit count: 331
cocoa-touch
|animation
Hi everyone.
I have a UITableView that has two modes. When we switch between the modes I have a different number of sections and cells per section. Ideally, it would do some cool animation when the table grows or shrinks.
Here is the code I tried, but it doesn't do anything:
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.5];
[self.tableView reloadData];
[UIView commitAnimations];
Any thoughts on how I could do this?
Thanks in advance.
© Stack Overflow or respective owner