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

# sizeOfLabel(_:)

Calculates the size of the receiver’s label.

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

## Discussion

If `shouldTruncateLabel` is <doc://com.apple.documentation/documentation/Swift/false>, returns the size of the receiver’s full label. If `shouldTruncateLabel` is <doc://com.apple.documentation/documentation/Swift/true>, returns the truncated size. If your application does anything to change the size of tab labels, such as overriding the [`drawLabel(_:in:)`](/documentation/AppKit/NSTabViewItem/drawLabel(_:in:)) method to add an icon to each tab, you should override [`sizeOfLabel(_:)`](/documentation/AppKit/NSTabViewItem/sizeOfLabel(_:)) too so the NSTabView knows the correct size for the tab label.

## See Also

[`var font: NSFont`](/documentation/AppKit/NSTabView/font)

The font used for the tab view’s label text.



---

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)