---
title: UIGraphicsPopContext()
framework: uikit
role: symbol
role_heading: Function
path: uikit/uigraphicspopcontext()
---

# UIGraphicsPopContext()

Removes the current graphics context from the top of the stack, restoring the previous context.

## Declaration

```swift
func UIGraphicsPopContext()
```

## Discussion

Discussion Use this function to balance calls to the UIGraphicsPushContext(_:) function. This function may be called from any thread of your app.

## See Also

### Graphics context primitives

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