---
title: "tabViewItem(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstabviewcontroller/tabviewitem(for:)"
---

# tabViewItem(for:)

Returns the tab view item for the specified child view controller.

## Declaration

```swift
func tabViewItem(for viewController: NSViewController) -> NSTabViewItem?
```

## Parameters

- `viewController`: The child view controller whose tab view item you want.

## Return Value

Return Value The tab view item associated with the view controller or nil if the view controller is not managed by the tab view controller.

## Discussion

Discussion This method is a convenient way to map a tab view item to a newly added child view controller. When you add child view controllers using the addChild(_:) method, the tab view automatically controller creates a new tab view item. Use this method to fetch that tab view item and configure it.

## See Also

### Managing Tab View Items

- [tabViewItems](appkit/nstabviewcontroller/tabviewitems.md)
- [addTabViewItem(_:)](appkit/nstabviewcontroller/addtabviewitem(_:).md)
- [insertTabViewItem(_:at:)](appkit/nstabviewcontroller/inserttabviewitem(_:at:).md)
- [removeTabViewItem(_:)](appkit/nstabviewcontroller/removetabviewitem(_:).md)
- [selectedTabViewItemIndex](appkit/nstabviewcontroller/selectedtabviewitemindex.md)
