views:

318

answers:

1

Hi,

I want to move a row to the bottom of my UITableView with cool animation effect just like in Grocery Shopping List app. How can I create such animation?

-Alex

+2  A: 

I don't know what is the "cool animation effect just like in Grocery Shopping List app". Not everyone has that app.


Rows cannot be moved programmatically.

However, you can simultaneously insert and delete a row to simulate a move.

[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:rowToMove]
                 withRowAnimation:UITableViewRowAnimationLeft];
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPathToMoveTo]
                 withRowAnimation:UITableViewRowAnimationLeft];
// update your dataSource as well.
[tableView endUpdates];
KennyTM
Kenny,The effect I was talking about is a falling row animation, just like dragging it with a finger when a table is in rearrange mode.I'm wondering how it was done. I think about drawing the cell content into semi transparent uiimage and then move the image with animation into desired location, but i'm not sure that's the best solution
Alex