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

# outlineView(_:isItemExpandable:)

Returns a Boolean value that indicates whether the a given item is expandable.

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

## Parameters

`outlineView`

The outline view that sent the message.

`item`

An item in the data source.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `item` can be expanded to display its children, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method may be called quite often, so it must be efficient.

> Important:
> While this method is marked as `@optional` in the protocol, **you must implement this method if you are not providing the data for the outline view using Cocoa bindings.**
> 
> Do not call ``doc://com.apple.appkit/documentation/AppKit/NSTableView/reloadData()`` from this method.

---

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)