tableView(_:selectionIndexesForProposedSelection:)
Asks the delegate to accept or reject the proposed selection.
Declaration
@MainActor optional func tableView(_ tableView: NSTableView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSetParameters
- tableView:
The table view that sent the message.
- proposedSelectionIndexes:
An index set containing the indexes of the proposed selection.
Return Value
An NSIndexSet instance containing the indexes of the new selection. Return proposedSelectionIndexes if the proposed selection is acceptable, or the value of the table view’s existing selection to avoid changing the selection.
Discussion
This method may be called multiple times with one new index added to the existing selection to find out if a particular index can be selected when the user is extending the selection with the keyboard or mouse.
If implemented, this method will be called instead of tableView(_:shouldSelectRow:).