---
title: "flush(removingDisplayedImage:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avsamplebuffervideorenderer/receiver/flush(removingdisplayedimage:)"
---

# flush(removingDisplayedImage:)

Instructs the receiver to discard pending enqueued sample buffers and call the provided block when complete. This method suspends until the flush is complete.

## Declaration

```swift
nonisolated(nonsending) func flush(removingDisplayedImage removeDisplayedImage: Bool) async
```

## Parameters

- `removeDisplayedImage`: Set to true to remove any currently displayed image, false to preserve any current image.

## Discussion

Discussion A flush resets decoder state. The next frame passed to enqueueSampleBuffer: should be an IDR frame (also known as a key frame or sync sample).

## See Also

### Flushing the receiver

- [flush()](avfoundation/avsamplebuffervideorenderer/receiver/flush().md)
