---
title: "outlineView(_:shouldSelectItem:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsoutlineviewdelegate/outlineview(_:shouldselectitem:)"
---

# outlineView(_:shouldSelectItem:)

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

## Declaration

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

## Parameters

- `outlineView`: The outline view that sent the message.
- `item`: The item.

## Return Value

Return Value true to permit outlineView to select item, false to deny permission.

## Discussion

Discussion You implement this method to disallow selection of particular items. For better performance and finer grain control over the selection, use outlineView(_:selectionIndexesForProposedSelection:).

## See Also

### Handling Selection

- [outlineView(_:shouldSelect:)](appkit/nsoutlineviewdelegate/outlineview(_:shouldselect:).md)
- [outlineView(_:selectionIndexesForProposedSelection:)](appkit/nsoutlineviewdelegate/outlineview(_:selectionindexesforproposedselection:).md)
- [selectionShouldChange(in:)](appkit/nsoutlineviewdelegate/selectionshouldchange(in:).md)
- [outlineViewSelectionIsChanging(_:)](appkit/nsoutlineviewdelegate/outlineviewselectionischanging(_:).md)
- [outlineViewSelectionDidChange(_:)](appkit/nsoutlineviewdelegate/outlineviewselectiondidchange(_:).md)
