---
title: context
framework: coregraphics
role: symbol
role_heading: Instance Property
path: coregraphics/cglayer/context
---

# context

Returns the graphics context associated with a layer object.

## Declaration

```swift
var context: CGContext? { get }
```

## Discussion

Discussion The context that’s returned is the context for the layer itself, not the context that you specified when you created the layer.

## See Also

### Examining a Layer

- [size](coregraphics/cglayer/size.md)
