<!--
{
  "availability" : [
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindowTabGroup/selectedWindow",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindowTabGroup(py)selectedWindow"
  },
  "title" : "selectedWindow"
}
-->

# selectedWindow

The selected, or frontmost, window in the tab group.

```
weak var selectedWindow: NSWindow? { get set }
```

## Discussion

This property returns the currently selected window within the tabbed window group. Setting this property visually changes the selected tab.

> Important:
> This property raises an exception if set to a window that is not already a member of the tab group.

You can monitor this property for changes using key-value observing.

---

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)