Alex Rivera | Logout

UITableView animate row reordering upon sort

Asked 2011-02-21T21:17:23.923
16

I have a table that users can sort in two different ways. When users change between these two sorting modes, I want the re-sort to be animated. And while UITableView's methods provide animation help for inserting, deleting, and reloading rows, I don't see anything that lets me animate row movement.

Am I missing something?

Assuming I'm not, does anyone have any sample code on how to do this?

Thanks.

Edit
Report

1 Answer

1

Have you tried using moveRowAtIndexPath:toIndexPath: inside a beginUpdates-endUpdates block? It seems to be what the developer docs are currently recommending. If that doesn't work on its own you could also try wrapping it in a [UIView animateWithDuration:animations:] block.

Link to the ADC documentation for UITableView: https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html#//apple_ref/doc/c_ref/UITableView

answered 2012-01-05T04:46:20.780

Your Answer