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
Handling row selection in a table viewSelecting multiple items with a two-finger pan gesturetableView(_:willSelectRowAt:)tableView(_:didSelectRowAt:)tableView(_:willDeselectRowAt:)tableView(_:didDeselectRowAt:)tableView(_:shouldBeginMultipleSelectionInteractionAt:)tableViewDidEndMultipleSelectionInteraction(_:)