Contents

tableView(_:titleForDeleteConfirmationButtonForRowAt:)

Changes the default title of the delete-confirmation button.

Declaration

optional func tableView(_ tableView: UITableView, titleForDeleteConfirmationButtonForRowAt indexPath: IndexPath) -> String?

Parameters

  • tableView:

    The table view requesting this information.

  • indexPath:

    An index path locating the row in its section.

Return Value

A localized string to used as the title of the delete-confirmation button.

Discussion

By default, the delete-confirmation button, which appears on the right side of the cell, has the title of “Delete”. The table view displays this button when the user attempts to delete a row, either by swiping the row or tapping the red minus icon in editing mode. You can implement this method to return an alternative title, which should be localized.

See Also

Editing table rows