Instance Method


Asks the delegate to return a new index path to retarget a proposed move of a row.


optional func tableView(_ tableView: UITableView, targetIndexPathForMoveFromRowAt sourceIndexPath: IndexPath, toProposedIndexPath proposedDestinationIndexPath: IndexPath) -> IndexPath



The table-view object that is requesting this information.


An index-path object identifying the original location of a row (in its section) that is being dragged.


An index-path object identifying the currently proposed destination of the row being dragged.

Return Value

An index-path object locating the desired row destination for the move operation. Return proposedDestinationIndexPath if that location is suitable.


This method allows customization of the target row for a particular row as it is being moved up and down a table view. As the dragged row hovers over another row, the destination row slides downward to visually make room for the relocation; this is the location identified by proposedDestinationIndexPath.