---
title: snapshot
framework: glkit
role: symbol
role_heading: Instance Property
path: glkit/glkview/snapshot
---

# snapshot

Draws the contents of the view and returns them as a new image object.

## Declaration

```swift
var snapshot: UIImage { get }
```

## Return Value

Return Value An image object.

## Discussion

Discussion When this method is called, the view sets up a drawing environment and calls your drawing method. However, instead of presenting the view’s contents on screen, they are returned to your application as an image instead. This method should be called whenever your application explicitly needs the contents of the view; never attempt to directly read the contents of the underlying framebuffer using OpenGL ES functions. Never call this method inside your drawing function.

## See Also

### Drawing Your View’s Contents

- [context](glkit/glkview/context.md)
- [bindDrawable()](glkit/glkview/binddrawable().md)
- [enableSetNeedsDisplay](glkit/glkview/enablesetneedsdisplay.md)
- [display()](glkit/glkview/display().md)
