---
title: selectedWindow
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindowtabgroup/selectedwindow
---

# selectedWindow

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

## Declaration

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

## Discussion

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.

## See Also

### Managing Tabbed Windows

- [windows](appkit/nswindowtabgroup/windows.md)
- [addWindow(_:)](appkit/nswindowtabgroup/addwindow(_:).md)
- [insertWindow(_:at:)](appkit/nswindowtabgroup/insertwindow(_:at:).md)
- [removeWindow(_:)](appkit/nswindowtabgroup/removewindow(_:).md)
