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

# view

The view controller’s primary view.

```
@IBOutlet var view: NSView { get set }
```

## Discussion

If this property’s value is not already set when you access it, the view controller invokes the [`loadView()`](/documentation/AppKit/NSViewController/loadView()) method. That method, in turn, sets the view from the nib file identified by the view controller’s [`nibName`](/documentation/AppKit/NSViewController/nibName) and [`nibBundle`](/documentation/AppKit/NSViewController/nibBundle) properties.

If you want to set a view controller’s view directly, set this property’s value immediately after creating the view controller.

---

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)