---
title: "tableView(_:canPerformPrimaryActionForRowAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdelegate/tableview(_:canperformprimaryactionforrowat:)"
---

# tableView(_:canPerformPrimaryActionForRowAt:)

Asks the delegate whether to perform a primary action for the row at the specified index path.

## Declaration

```swift
optional func tableView(_ tableView: UITableView, canPerformPrimaryActionForRowAt indexPath: IndexPath) -> Bool
```

## Parameters

- `tableView`: The table view object asking whether to perform a primary action.
- `indexPath`: The index path of the row.

## Return Value

Return Value true if the primary action can be performed; otherwise, false. If you don’t implement this method, the default return value is true when the table view isn’t in an editing state, and false when it is.

## Discussion

Discussion Primary actions allow you to distinguish between a distinct user action and a change in selection (like a focus change or other indirect selection change). A primary action occurs when a person selects a single row without extending an existing selection. UIKit calls this method before tableView(_:performPrimaryActionForRowAt:).

## See Also

### Performing primary actions

- [tableView(_:performPrimaryActionForRowAt:)](uikit/uitableviewdelegate/tableview(_:performprimaryactionforrowat:).md)
