Instance Method

tableView(_:moveRowAt:to:)

Tells the data source to move a row at a specific location in the table view to another location.

Declaration

optional func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)

Parameters

tableView

The table-view object requesting this action.

fromIndexPath

An index path locating the row to be moved in tableView.

toIndexPath

An index path locating the row in tableView that is the destination of the move.

Discussion

The UITableView object sends this message to the data source when the user presses the reorder control in fromRow.

See Also

Reordering Table Rows

func tableView(UITableView, canMoveRowAt: IndexPath) -> Bool

Asks the data source whether a given row can be moved to another location in the table view.