---
title: "tableView(_:canMoveRowAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdatasource/tableview(_:canmoverowat:)"
---

# tableView(_:canMoveRowAt:)

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

## Declaration

```swift
optional func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool
```

## Parameters

- `tableView`: The table-view object requesting this information.
- `indexPath`: An index path locating a row in tableView.

## Return Value

Return Value true if the row can be moved; otherwise, false.

## Discussion

Discussion This method allows the data source to specify that the reordering control for the specified row not be shown. By default, the reordering control is shown if the data source implements the tableView(_:moveRowAt:to:) method.

## See Also

### Reordering table rows

- [tableView(_:moveRowAt:to:)](uikit/uitableviewdatasource/tableview(_:moverowat:to:).md)
