---
title: flush()
framework: coregraphics
role: symbol
role_heading: Instance Method
path: coregraphics/cgcontext/flush()
---

# flush()

Forces all pending drawing operations in a window context to be rendered immediately to the destination device.

## Declaration

```swift
func flush()
```

## Discussion

Discussion When you call this function, Core Graphics immediately flushes the current drawing to the destination device (for example, a screen). Because the system software flushes a context automatically at the appropriate times, calling this function could have an adverse effect on performance. Under normal conditions, you do not need to call this function.

## See Also

### Managing a Graphics Context

- [synchronize()](coregraphics/cgcontext/synchronize().md)
- [setBlendMode(_:)](coregraphics/cgcontext/setblendmode(_:).md)
- [CGBlendMode](coregraphics/cgblendmode.md)
- [setRenderingIntent(_:)](coregraphics/cgcontext/setrenderingintent(_:).md)
