Contents

tableView(_:shouldShowMenuForRowAt:)

Asks the delegate if the editing menu should be shown for a certain row.

Declaration

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

Parameters

  • tableView:

    The table view that is making this request.

  • indexPath:

    The index path of the row.

Return Value

true if the editing menu should be shown positioned near the row and pointing to it, otherwise false. The default value is false.

Discussion

If the user tap-holds a certain row in the table view, this method (if implemented) is invoked first. Return false if the editing menu shouldn’t be shown—for example, the cell corresponding to the row contains content that shouldn’t be copied or pasted over.

See Also

Responding to row actions