Contents

tableView(_:didBeginMultipleSelectionInteractionAt:)

Tells the delegate when the user starts using a two-finger pan gesture to select multiple rows in a table view.

Declaration

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

Parameters

  • tableView:

    The table view calling this method.

  • indexPath:

    The index path of the item that the user touched to start the two-finger pan gesture.

Discussion

Your implementation of this method is a good place to indicate, in the app’s user interface, that the user is selecting multiple rows; for example, you could replace an Edit or Select button with a Done button.

override func tableView(_ tableView: UITableView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) {
    // Replace the Edit button with Done, and put the
    // table view into editing mode.
    self.setEditing(true, animated: true)
}

See Also

Responding to row selections