Contents

tableView(_:shouldSelectRow:)

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

Declaration

@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

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

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