---
title: "sizeOfLabel(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstabviewitem/sizeoflabel(_:)"
---

# sizeOfLabel(_:)

Calculates the size of the receiver’s label.

## Declaration

```swift
func sizeOfLabel(_ computeMin: Bool) -> NSSize
```

## Discussion

Discussion If shouldTruncateLabel is false, returns the size of the receiver’s full label. If shouldTruncateLabel is true, returns the truncated size. If your application does anything to change the size of tab labels, such as overriding the drawLabel(_:in:) method to add an icon to each tab, you should override sizeOfLabel(_:) too so the NSTabView knows the correct size for the tab label.

## See Also

### Related Documentation

- [font](appkit/nstabview/font.md)

### Working with Labels

- [drawLabel(_:in:)](appkit/nstabviewitem/drawlabel(_:in:).md)
- [label](appkit/nstabviewitem/label.md)
