---
title: "tableView(_:moveRowAt:to:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdatasource/tableview(_:moverowat:to:)"
---

# tableView(_:moveRowAt:to:)

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

## Declaration

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

## Parameters

- `tableView`: The table-view object requesting this action.
- `sourceIndexPath`: An index path locating the row to be moved in tableView.
- `destinationIndexPath`: An index path locating the row in tableView that’s the destination of the move.

## Discussion

Discussion The UITableView object sends this message to the data source when the user presses the reorder control in the row at sourceIndexPath.

## See Also

### Related Documentation

- [tableView(_:commit:forRowAt:)](uikit/uitableviewdatasource/tableview(_:commit:forrowat:).md)

### Reordering table rows

- [tableView(_:canMoveRowAt:)](uikit/uitableviewdatasource/tableview(_:canmoverowat:).md)
