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

# indexOfTabViewItem(withIdentifier:)

Returns the index of the item that matches the specified identifier or `NSNotFound` if the item is not found.

```
func indexOfTabViewItem(withIdentifier identifier: Any) -> Int
```

## Parameters

`identifier`

The identifier of a tab view item.

## Return Value

The zero-based index of the tab view item corresponding to `identifier`, 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)