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

# tabView(_:willSelect:)

Informs the tab view controller that the specified tab is about to be selected.

```
@MainActor func tabView(_ tabView: NSTabView, willSelect tabViewItem: NSTabViewItem?)
```

## Parameters

`tabView`

The tab view object whose tab is about to be selected.

`tabViewItem`

The tab view item that will be selected.

## Discussion

This method is a delegate method called by the [`NSTabView`](/documentation/AppKit/NSTabView) object when changes occur. Use it to update your UI or perform any tasks before a tab is selected.

If you override this method, you must call `super` at some point in your implementation.

---

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)