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

# view

Returns the OpenGL context’s view.

```
@MainActor weak var view: NSView? { get set }
```

## Return Value

The view, or `nil` if the receiver has no drawable object, is in full-screen mode, or is in offscreen mode.

## See Also

[`setOffScreen:width:height:rowbytes:`](/documentation/AppKit/NSOpenGLContext/setOffScreen:width:height:rowbytes:)

Instructs the OpenGL context to render into an offscreen buffer with the specified attributes.

[`setFullScreen`](/documentation/AppKit/NSOpenGLContext/setFullScreen)

Sets the OpenGL context to full-screen mode.



---

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)