---
title: cgContext
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uigraphicsrenderercontext/cgcontext
---

# cgContext

The underlying Core Graphics context.

## Declaration

```swift
var cgContext: CGContext { get }
```

## Discussion

Discussion Use this property to gain access to the underlying Core Graphics context when you need more drawing functionality than is offered by UIKit and UIGraphicsRendererContext. For an example of how and when to use the Core Graphics context in an image renderer, see Using Core Graphics rendering functions in UIGraphicsImageRenderer.

## See Also

### Getting the drawing context

- [format](uikit/uigraphicsrenderercontext/format.md)
