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

# outlineView(_:selectionIndexesForProposedSelection:)

Invoked to allow the delegate to modify the proposed selection.

```
@MainActor optional func outlineView(_ outlineView: NSOutlineView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet
```

## Parameters

`outlineView`

The outline 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.

Implementation of this method is optional. If implemented, this method will be called instead of [`outlineView(_:shouldSelectItem:)`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldSelectItem:)).

---

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)