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

# addTabViewItem(_:)

Adds the specified tab item.

```
func addTabViewItem(_ tabViewItem: NSTabViewItem)
```

## Parameters

`tabViewItem`

The tab view item to be added.

## Discussion

The item is added at the end of the array of tab items, so the new tab appears on the right side of the view. If the delegate supports it, it invokes the delegate’s [`tabViewDidChangeNumberOfTabViewItems(_:)`](/documentation/AppKit/NSTabViewDelegate/tabViewDidChangeNumberOfTabViewItems(_:)) method.

## See Also

  [Tab View Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TabView/TabView.html#//apple_ref/doc/uid/10000074i)

[`-  tabViewItemAtIndex:`](/documentation/AppKit/NSTabView/tabViewItem(at:)-7r3at)

Returns the tab view item at `index` in the tab view’s array of items.

[`numberOfTabViewItems`](/documentation/AppKit/NSTabView/numberOfTabViewItems)

The number of items in the tab view’s array of tab view items.

[`tabViewItems`](/documentation/AppKit/NSTabView/tabViewItems)

The tab view’s array of tab view items.



---

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)