---
title: "init(frame:context:)"
framework: glkit
role: symbol
role_heading: Initializer
path: "glkit/glkview/init(frame:context:)"
---

# init(frame:context:)

Initializes a new view.

## Declaration

```swift
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 thedoc://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

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