---
title: "removeTabViewItem(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstabviewcontroller/removetabviewitem(_:)"
---

# removeTabViewItem(_:)

Removes the specified tab view item from the tab view controller.

## Declaration

```swift
func removeTabViewItem(_ tabViewItem: NSTabViewItem)
```

## Parameters

- `tabViewItem`: The tab view item to remove. If this parameter is nil or the item does not belong to the tab view controller, this method throws an exception.

## Discussion

Discussion Use this method to remove a tab view item from the tab view interface. Removing the item removes the corresponding view controller from the tab view controller’s list of child view controllers. If the removed tab view item is currently selected, the tab view controller selects the next item (or the previous item if there is no next item). Removing the last tab view item sets the selectedTabViewItemIndex property to -1.

## See Also

### Managing Tab View Items

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