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

# tabView(_:shouldSelect:)

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

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

<doc://com.apple.documentation/documentation/Swift/true> if the tab should be selected or <doc://com.apple.documentation/documentation/Swift/false> if it should not be selected.

## Discussion

This method is a delegate method called by the [`NSTabView`](/documentation/AppKit/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.

---

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)