<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTabViewDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTabViewDelegate"
  },
  "title" : "NSTabViewDelegate"
}
-->

# NSTabViewDelegate

The `NSTabViewDelegate` protocol defines the optional methods implemented by delegates of `NSTabView` objects.

```
protocol NSTabViewDelegate : NSObjectProtocol
```

## Topics

### Adding and Removing Tabs

[`-  tabViewDidChangeNumberOfTabViewItems:`](/documentation/AppKit/NSTabViewDelegate/tabViewDidChangeNumberOfTabViewItems(_:))

Informs the delegate that the number of tab view items in `tabView` has changed.

### Selecting a Tab

[`-  tabView:shouldSelectTabViewItem:`](/documentation/AppKit/NSTabViewDelegate/tabView(_:shouldSelect:))

Invoked just before `tabViewItem` in `tabView` is selected.

[`-  tabView:willSelectTabViewItem:`](/documentation/AppKit/NSTabViewDelegate/tabView(_:willSelect:))

Informs the delegate that `tabView` is about to select `tabViewItem`.

[`-  tabView:didSelectTabViewItem:`](/documentation/AppKit/NSTabViewDelegate/tabView(_:didSelect:))

Informs the delegate that `tabView` has selected `tabViewItem`.

## Relationships

### Conforming Types

[`NSTabViewController`](/documentation/AppKit/NSTabViewController)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)