<!--
{
  "availability" : [
    "iOS: 5.0.0 - 12.0.0",
    "iPadOS: 5.0.0 - 12.0.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GLKit",
  "identifier" : "/documentation/GLKit/GLKView/init(frame:context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "GLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GLKView(im)initWithFrame:context:"
  },
  "title" : "init(frame:context:)"
}
-->

# init(frame:context:)

Initializes a new view.

```
init(frame: CGRect, context: EAGLContext)
```

## Parameters

`frame`

The frame rectangle for the view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This method uses the frame rectangle to set the<doc://com.apple.documentation/documentation/UIKit/UIView/center> and <doc://com.apple.documentation/documentation/UIKit/UIView/bounds> properties accordingly.

`context`

An OpenGL ES context used to store the framebuffer object.

## Return Value

An initialized view object or `nil` if the object couldn’t be created.

---

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)