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

# outlineView(_:shouldShowOutlineCellForItem:)

Returns whether the specified item should display the outline cell (the disclosure triangle).

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

## Parameters

`outlineView`

The outline view that sent the message.

`item`

An item in the outline view.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the outline cell should be displayed, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Returning <doc://com.apple.documentation/documentation/Swift/false> causes [`frameOfOutlineCell(atRow:)`](/documentation/AppKit/NSOutlineView/frameOfOutlineCell(atRow:)) to return `NSZeroRect`, hiding the cell. In addition, the row will not be collapsible by keyboard shortcuts.

This method is called only for expandable rows.

---

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)