<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableViewDelegate/tableView(_:selectionIndexesForProposedSelection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTableViewDelegate(im)tableView:selectionIndexesForProposedSelection:"
  },
  "title" : "tableView(_:selectionIndexesForProposedSelection:)"
}
-->

# tableView(_:selectionIndexesForProposedSelection:)

Asks the delegate to accept or reject the proposed selection.

```
@MainActor optional func tableView(_ tableView: NSTableView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet
```

## Parameters

`tableView`

The table view that sent the message.

`proposedSelectionIndexes`

An index set containing the indexes of the proposed selection.

## Return Value

An <doc://com.apple.documentation/documentation/Foundation/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:)`](/documentation/AppKit/NSTableViewDelegate/tableView(_:shouldSelectRow:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)