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

# drawLabel(_:in:)

Draws the receiver’s label in `tabRect`, which is the area between the curved end caps.

```
func drawLabel(_ shouldTruncateLabel: Bool, in labelRect: NSRect)
```

## Discussion

If `shouldTruncateLabel` is <doc://com.apple.documentation/documentation/Swift/false>, draws the full label in the rectangle specified by `tabRect`. If `shouldTruncateLabel` is <doc://com.apple.documentation/documentation/Swift/true>, draws the truncated label. You can override this method to perform customized label drawing. For example, you might want to add an icon to each tab in the view.

---

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)