<!--
{
  "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(_:canEditRowAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDataSource(im)tableView:canEditRowAtIndexPath:"
  },
  "title" : "tableView(_:canEditRowAt:)"
}
-->

# tableView(_:canEditRowAt:)

Asks the data source to verify that the given row is editable.

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

## Parameters

`tableView`

The table-view object requesting this information.

`indexPath`

An index path locating a row in `tableView`.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the row indicated by `indexPath` is editable; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The method permits the data source to exclude individual rows from being treated as editable. Editable rows display the insertion or deletion control in their cells. If this method isn’t implemented, all rows are assumed to be editable. Rows that aren’t editable ignore the [`editingStyle`](/documentation/UIKit/UITableViewCell/editingStyle-swift.property) property of a `UITableViewCell` object and do no indentation for the deletion or insertion control. Rows that are editable, but that don’t want to have an insertion or remove control shown, can return [`UITableViewCell.EditingStyle.none`](/documentation/UIKit/UITableViewCell/EditingStyle-swift.enum/none) from the [`tableView(_:editingStyleForRowAt:)`](/documentation/UIKit/UITableViewDelegate/tableView(_:editingStyleForRowAt:)) delegate method.

---

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)