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

# selectedViewController

The view controller associated with the selected object..

```
var selectedViewController: NSViewController? { get }
```

## Discussion

May be `nil` if not using view controllers.

This property is only relevant in book mode. See [`Book Mode (View Controller Mode)`](/documentation/AppKit/NSPageController#Book-Mode-View-Controller-Mode) for details.

---

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)