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

# indexOfTabViewItem(_:)

Returns the index of the specified item in the tab view.

```
func indexOfTabViewItem(_ tabViewItem: NSTabViewItem) -> Int
```

## Parameters

`tabViewItem`

The tab view item.

## Return Value

The zero-based index of `tabViewItem`, or `NSNotFound` if the item is not found.

## Discussion

The returned index is zero-based.

## See Also

[`-  insertTabViewItem:atIndex:`](/documentation/AppKit/NSTabView/insertTabViewItem(_:at:))

Inserts the specified item into the tab view’s array of tab view items at the specified index.



---

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)