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

# outlineView(_:sizeToFitWidthOfColumn:)

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

## Declaration

```swift
@MainActor optional func outlineView(_ outlineView: NSOutlineView, sizeToFitWidthOfColumn column: Int) -> CGFloat
```

## Parameters

- `outlineView`: The outline view that sent the message.
- `column`: The index of the column.

## Return Value

Return Value The width of the specified column.

## Discussion

Discussion By default, NSOutlineView iterates every row in the table, accesses a cell via preparedCell(atColumn:row:), and requests the cellSize to find the appropriate largest width to use. For accurate results and performance, it is recommended that this method is implemented when using large tables. By default, large tables use a monte carlo simulation instead of iterating every row.

## See Also

### Customizing Column and Row Sizes

- [outlineView(_:heightOfRowByItem:)](appkit/nsoutlineviewdelegate/outlineview(_:heightofrowbyitem:).md)
