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

# tabView(_:shouldSelect:)

Asks the tab view controller if the specified tab should be selected.

## Declaration

```swift
@MainActor func tabView(_ tabView: NSTabView, shouldSelect tabViewItem: NSTabViewItem?) -> Bool
```

## Parameters

- `tabView`: The tab view object making the request.
- `tabViewItem`: The tab view item to select.

## Return Value

Return Value true if the tab should be selected or false if it should not be selected.

## Discussion

Discussion This method is a delegate method called by the NSTabView object when changes occur. Use it to dynamically determine whether a tab should be 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(_:willSelect:)](appkit/nstabviewcontroller/tabview(_:willselect:).md)
- [tabView(_:didSelect:)](appkit/nstabviewcontroller/tabview(_:didselect:).md)
