Contents

tableView(_:contextMenuConfigurationForRowAt:point:)

Returns a context menu configuration for the row at a point.

Declaration

optional func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?

Parameters

  • tableView:

    The table view containing the row.

  • indexPath:

    The index path of the row.

  • point:

    The location of the interaction in the table view’s coordinate space.

Return Value

A context menu configuration for the indexPath.

Discussion

Use this method to provide a UIContextMenuConfiguration describing the menu to present. Return nil to prevent the interaction from beginning. Return an empty configuration to begin the interaction and then fail with a cancellation effect. Use the empty configuration to indicate to users that it’s possible for this element to present a menu, but that there are no actions to present at this time.

See Also

Managing context menus