Instance Method

tableView(_:shouldBeginMultipleSelectionInteractionAt:)

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

Declaration

optional func tableView(_ tableView: UITableView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool

Parameters

tableView

The table view calling this method.

indexPath

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

Return Value

true to allow the user to select multiple rows using a two-finger pan gesture; otherwise, false to disable the behavior. The default value is false.

Discussion

To support the two-finger pan gesture for multiple selection, you must set the allowsMultipleSelectionDuringEditing property to true when configuring the table view.

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.

func tableView(UITableView, willSelectRowAt: IndexPath) -> IndexPath?

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

func tableView(UITableView, didSelectRowAt: IndexPath)

Tells the delegate that the specified row is now selected.

func tableView(UITableView, willDeselectRowAt: IndexPath) -> IndexPath?

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

func tableView(UITableView, didDeselectRowAt: IndexPath)

Tells the delegate that the specified row is now deselected.

func tableView(UITableView, didBeginMultipleSelectionInteractionAt: IndexPath)

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

func tableViewDidEndMultipleSelectionInteraction(UITableView)

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