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

# outlineView(_:shouldSelectItem:)

Returns a Boolean value that indicates whether the outline view should select a given item.

```
@MainActor optional func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool
```

## Parameters

`outlineView`

The outline view that sent the message.

`item`

The item.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to permit `outlineView` to select `item`, <doc://com.apple.documentation/documentation/Swift/false> to deny permission.

## Discussion

You implement this method to disallow selection of particular items.

For better performance and finer grain control over the selection, use [`outlineView(_:selectionIndexesForProposedSelection:)`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:selectionIndexesForProposedSelection:)).

---

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)