<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableViewDataSource/tableView(_:moveRowAt:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDataSource(im)tableView:moveRowAtIndexPath:toIndexPath:"
  },
  "title" : "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.

```
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

The [`UITableView`](/documentation/UIKit/UITableView) object sends this message to the data source when the user presses the reorder control in the row at `sourceIndexPath`.

## See Also

[`tableView(_:commit:forRowAt:)`](/documentation/UIKit/UITableViewDataSource/tableView(_:commit:forRowAt:))

Asks the data source to commit the insertion or deletion of a specified row.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)