Contents

tableView(_:willBeginEditingRowAt:)

Tells the delegate that the table view is about to go into editing mode.

Declaration

optional func tableView(_ tableView: UITableView, willBeginEditingRowAt indexPath: IndexPath)

Parameters

  • tableView:

    The table view providing this information.

  • indexPath:

    An index path locating the row in tableView.

Discussion

This method is called when the user swipes horizontally across a row; as a consequence, the table view sets its isEditing property to true (thereby entering editing mode) and displays a Delete button in the row identified by indexPath. In this “swipe to delete” mode the table view does not display any insertion, deletion, and reordering controls. This method gives the delegate an opportunity to adjust the application’s user interface to editing mode. When the table exits editing mode (for example, the user taps the Delete button), the table view calls tableView(_:didEndEditingRowAt:).

See Also

Editing table rows