---
title: "tableView(_:shouldSelectRow:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstableviewdelegate/tableview(_:shouldselectrow:)"
---

# tableView(_:shouldSelectRow:)

Asks the delegate if the table view should allow selection of the specified row.

## Declaration

```swift
@MainActor optional func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool
```

## Parameters

- `tableView`: The table view that sent the message.
- `row`: The row index.

## Return Value

Return Value true to permit selection of the row, false to deny selection.

## Discussion

Discussion The delegate can implement this method to disallow selection of particular rows. For better performance and finer-grain control over the selection, use tableView(_:selectionIndexesForProposedSelection:).

## See Also

### Selecting rows

- [selectionShouldChange(in:)](appkit/nstableviewdelegate/selectionshouldchange(in:).md)
- [tableView(_:selectionIndexesForProposedSelection:)](appkit/nstableviewdelegate/tableview(_:selectionindexesforproposedselection:).md)
- [tableView(_:shouldSelect:)](appkit/nstableviewdelegate/tableview(_:shouldselect:).md)
- [tableViewSelectionIsChanging(_:)](appkit/nstableviewdelegate/tableviewselectionischanging(_:).md)
- [tableViewSelectionDidChange(_:)](appkit/nstableviewdelegate/tableviewselectiondidchange(_:).md)
- [tableView(_:shouldTypeSelectFor:withCurrentSearch:)](appkit/nstableviewdelegate/tableview(_:shouldtypeselectfor:withcurrentsearch:).md)
- [tableView(_:typeSelectStringFor:row:)](appkit/nstableviewdelegate/tableview(_:typeselectstringfor:row:).md)
- [tableView(_:nextTypeSelectMatchFromRow:toRow:for:)](appkit/nstableviewdelegate/tableview(_:nexttypeselectmatchfromrow:torow:for:).md)
