---
title: "UIGraphicsPushContext(_:)"
framework: uikit
role: symbol
role_heading: Function
path: "uikit/uigraphicspushcontext(_:)"
---

# UIGraphicsPushContext(_:)

Makes the specified graphics context the current context.

## Declaration

```swift
func UIGraphicsPushContext(_ context: CGContext)
```

## Parameters

- `context`: The graphics context to make the current context.

## Discussion

Discussion You can use this function to save the previous graphics state and make the specified context the current context. You must balance calls to this function with matching calls to the UIGraphicsPopContext() function. This function may be called from any thread of your app.

## See Also

### Graphics context primitives

- [UIGraphicsGetCurrentContext()](uikit/uigraphicsgetcurrentcontext().md)
- [UIGraphicsPopContext()](uikit/uigraphicspopcontext().md)
- [UIGraphicsBeginImageContextWithOptions(_:_:_:)](uikit/uigraphicsbeginimagecontextwithoptions(_:_:_:).md)
- [UIRectClip(_:)](uikit/uirectclip(_:).md)
