Contents

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

When the system recognizes a two-finger pan gesture, it calls this method before it sets isEditing to true. If you return true from this method, the user can select multiple rows using a two-finger pan gesture.

In macOS, the system calls this method when a user attempts to select multiple rows by holding a modifier key and clicking additional rows to select them.

To support multiple selection using the two-finger pan gesture (in iOS) or modifier keys (in macOS), set the allowsMultipleSelectionDuringEditing property to true when you configure the table view.

See Also

Responding to row selections