---
title: "tabView(_:willSelect:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstabviewcontroller/tabview(_:willselect:)"
---

# tabView(_:willSelect:)

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

## Declaration

```swift
@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

Discussion This method is a delegate method called by the 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.

## See Also

### Responding to Tab View Events

- [viewDidLoad()](appkit/nstabviewcontroller/viewdidload().md)
- [tabView(_:shouldSelect:)](appkit/nstabviewcontroller/tabview(_:shouldselect:).md)
- [tabView(_:didSelect:)](appkit/nstabviewcontroller/tabview(_:didselect:).md)
