Instance Method

tableView:didBeginMultipleSelectionInteractionAtIndexPath:

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

Declaration

- (void)tableView:(UITableView *)tableView didBeginMultipleSelectionInteractionAtIndexPath:(NSIndexPath *)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 View

Detect when a user taps a table view cell so your app can take the next indicated action.

Selecting Multiple Items with a Two-Finger Pan Gesture

Accelerate user selection of multiple items using the multiselect gesture on table and collection views.

- tableView:willSelectRowAtIndexPath:

Tells the delegate a row is about to be selected.

- tableView:didSelectRowAtIndexPath:

Tells the delegate a row is selected.

- tableView:willDeselectRowAtIndexPath:

Tells the delegate that a specified row is about to be deselected.

- tableView:didDeselectRowAtIndexPath:

Tells the delegate that the specified row is now deselected.

- tableView:shouldBeginMultipleSelectionInteractionAtIndexPath:

Asks the delegate whether the user can use a two-finger pan gesture to select multiple items in a table view.

- tableViewDidEndMultipleSelectionInteraction:

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