Instance Method

moveRowAtIndex:toIndex:

Moves the specified row to the new row location using animation.

Declaration

- (void)moveRowAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex;

Parameters

oldIndex

Initial row index.

newIndex

New row index.

Discussion

This is similar to removing a row at oldIndex and inserting it at newIndex, except the same view is used and simply has its position updated to the new location.

Changes happen incrementally as they are sent to the table, so as soon as this method is called the row can be considered moved. However the underlying view is not moved until endUpdates has been called.

This method can be called multiple times within the same beginUpdates and endUpdates block.

See Also

Updating the Table View Arrangement

- beginUpdates

Begins a group of updates for the table view.

- endUpdates

Ends the group of updates for the table view.

- insertRowsAtIndexes:withAnimation:

Inserts the rows using the specified animation.

- removeRowsAtIndexes:withAnimation:

Removes the rows using the specified animation.

- rowForView:

Returns the index of the row for the specified view.

- columnForView:

Returns the column index for the specified view.