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

# NSOutlineViewDelegate

A set of optional methods implemented by delegates of [`NSOutlineView`](/documentation/AppKit/NSOutlineView) objects.

```
protocol NSOutlineViewDelegate : NSControlTextEditingDelegate
```

## Topics

### Expanding and Collapsing the Outline

[`-  outlineView:shouldExpandItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldExpandItem:))

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

[`-  outlineView:shouldCollapseItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldCollapseItem:))

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

### Supporting Type Select

[`-  outlineView:typeSelectStringForTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:typeSelectStringFor:item:))

Returns the string that is used for type selection for a given column and item.

[`-  outlineView:nextTypeSelectMatchFromItem:toItem:forString:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:nextTypeSelectMatchFromItem:toItem:for:))

Returns the first item that matches the searchString from within the range of startItem to endItem

[`-  outlineView:shouldTypeSelectForEvent:withCurrentSearchString:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldTypeSelectFor:withCurrentSearch:))

Returns a Boolean value that indicates whether type select should proceed for a given event and search string.

### Working with Tooltips

[`-  outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:toolTipFor:rect:tableColumn:item:mouseLocation:))

When the cursor pauses over a given cell, the value returned from this method is displayed in a tooltip.

### Handling Selection

[`-  outlineView:shouldSelectTableColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldSelect:))

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

[`-  outlineView:shouldSelectItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldSelectItem:))

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

[`-  outlineView:selectionIndexesForProposedSelection:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:selectionIndexesForProposedSelection:))

Invoked to allow the delegate to modify the proposed selection.

[`-  selectionShouldChangeInOutlineView:`](/documentation/AppKit/NSOutlineViewDelegate/selectionShouldChange(in:))

Returns a Boolean value that indicates whether the outline view should change its selection.

[`-  outlineViewSelectionIsChanging:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewSelectionIsChanging(_:))

Invoked when `notification` is posted—that is, whenever the outline view’s selection changes.

[`-  outlineViewSelectionDidChange:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewSelectionDidChange(_:))

Invoked when the selection did change notification is posted—that is, immediately after the outline view’s selection has changed.

### Displaying Cells

[`-  outlineView:willDisplayCell:forTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:willDisplayCell:for:item:))

Informs the delegate that the cell specified by the column and item will be displayed.

[`-  outlineView:willDisplayOutlineCell:forTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:willDisplayOutlineCell:for:item:))

Informs the delegate that an outline view is about to display a cell used to draw the expansion symbol.

[`-  outlineView:dataCellForTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:dataCellFor:item:))

Returns the cell to use in a given column for a given item.

[`-  outlineView:shouldShowOutlineCellForItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldShowOutlineCellForItem:))

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

[`-  outlineView:shouldShowCellExpansionForTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldShowCellExpansionFor:item:))

Invoked to allow the delegate to control cell expansion for a specific column and item.

### Moving and Resizing Columns

[`-  outlineView:shouldReorderColumn:toColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldReorderColumn:toColumn:))

Sent to the delegate to allow or prohibit the specified column to be dragged to a new location.

### Working with the Outline Column

[`-  outlineViewColumnDidMove:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewColumnDidMove(_:))

Invoked whenever the user moves a column in the outline view.

[`-  outlineViewColumnDidResize:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewColumnDidResize(_:))

Invoked whenever the user resizes a column in the outline view.

[`-  outlineViewItemWillExpand:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewItemWillExpand(_:))

Invoked when `notification` is posted—that is, whenever the user is about to expand an item in the outline view.

[`-  outlineViewItemDidExpand:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewItemDidExpand(_:))

Invoked when `notification` is posted—that is, whenever the user expands an item in the outline view.

[`-  outlineViewItemWillCollapse:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewItemWillCollapse(_:))

Invoked when `notification` is posted—that is, whenever the user is about to collapse an item in the outline view.

[`-  outlineViewItemDidCollapse:`](/documentation/AppKit/NSOutlineViewDelegate/outlineViewItemDidCollapse(_:))

Invoked when the did collapse notification is posted—that is, whenever the user collapses an item in the outline view.

### Editing Items

[`-  outlineView:shouldEditTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldEdit:item:))

Returns a Boolean value that indicates whether the outline view should allow editing of a given item in a given table column.

### Working with Table Columns

[`-  outlineView:mouseDownInHeaderOfTableColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:mouseDownInHeaderOf:))

Sent to the delegate whenever the mouse button is clicked in `outlineView` while the cursor is in a column header `tableColumn`.

[`-  outlineView:didClickTableColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:didClick:))

Sent at the time the mouse button subsequently goes up in `outlineView` and `tableColumn` has been “clicked” without having been dragged anywhere.

[`-  outlineView:didDragTableColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:didDrag:))

Sent at the time the mouse button goes up in `outlineView` and `tableColumn` has been dragged during the time the mouse button was down.

### Customizing Column and Row Sizes

[`-  outlineView:heightOfRowByItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:heightOfRowByItem:))

Returns the height in points of the row containing `item`.

[`-  outlineView:sizeToFitWidthOfColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:sizeToFitWidthOfColumn:))

Invoked to allow the delegate to provide custom sizing behavior when a column’s resize divider is double clicked.

### Customizing Tint Color

[`-  outlineView:tintConfigurationForItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:tintConfigurationForItem:))

Customizes an item’s tinting behavior.

[`NSTintConfiguration`](/documentation/AppKit/NSTintConfiguration)

An object that gives you the ability to choose from system-provided tinting behaviors.

### Customizing Tracking Support

[`-  outlineView:shouldTrackCell:forTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:shouldTrackCell:for:item:))

Returns a Boolean value that indicates whether a given cell should be tracked.

### Grouping Rows

[`-  outlineView:isGroupItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:isGroupItem:))

Returns a Boolean that indicates whether a given row should be drawn in the “group row” style.

### Working with NSView-Based Outline Views

[`-  outlineView:didAddRowView:forRow:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:didAdd:forRow:))

Implemented to know when a new row view is added to the table.

[`-  outlineView:didRemoveRowView:forRow:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:didRemove:forRow:))

Implemented to know when a row view is removed from the table

[`-  outlineView:rowViewForItem:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:rowViewForItem:))

implement this method to return a custom `NSTableRowView` for a particular item.

[`-  outlineView:viewForTableColumn:item:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:viewFor:item:))

Implemented to return the view used to display the specified item and column.

### Changing Visibility

[`-  outlineView:userCanChangeVisibilityOfTableColumn:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:userCanChangeVisibilityOf:))

[`-  outlineView:userDidChangeVisibilityOfTableColumns:`](/documentation/AppKit/NSOutlineViewDelegate/outlineView(_:userDidChangeVisibilityOf:))

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSControlTextEditingDelegate`](/documentation/AppKit/NSControlTextEditingDelegate)

---

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)