Instance Method


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


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



The table-view object requesting this information.


An index path locating a row in tableView.

Return Value

true if the row indicated by indexPath is editable; otherwise, false.


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 is not implemented, all rows are assumed to be editable. Rows that are not editable ignore the editingStyle property of a UITableViewCell object and do no indentation for the deletion or insertion control. Rows that are editable, but that do not want to have an insertion or remove control shown, can return UITableViewCell.EditingStyle.none from the tableView(_:editingStyleForRowAt:) delegate method.

See Also

Inserting or Deleting Table Rows

func tableView(UITableView, commit: UITableViewCell.EditingStyle, forRowAt: IndexPath)

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