Instance Method


Returns the height in points of the row containing item.


optional func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat



The outline view that sent the message.


The row item.

Return Value

The height of the row.


Values returned by this method should not include intercell spacing and must be greater than 0.

Implement this method to support an outline view with varying row heights.

For large tables in particular, you should make sure that this method is efficient. NSOutlineView may cache the values this method returns, so if you would like to change a row's height make sure to invalidate the row height by calling noteHeightOfRows(withIndexesChanged:). NSOutlineView automatically invalidates its entire row height cache in reloadData() and noteNumberOfRowsChanged().

If you call view(atColumn:row:makeIfNecessary:) or rowView(atRow:makeIfNecessary:) within your implementation of this method, an exception is thrown.

See Also

Customizing Column and Row Sizes

func outlineView(NSOutlineView, sizeToFitWidthOfColumn: Int) -> CGFloat

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