---
title: flush()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nswindow/flush()
---

# flush()

Flushes the window’s offscreen buffer to the screen if the window is buffered and flushing is enabled.

## Declaration

```swift
func flush()
```

## Discussion

Discussion Does nothing for other display devices, such as a printer. This method is automatically invoked by the NSWindow  display() and displayIfNeeded() methods and the corresponding NSView display() and displayIfNeeded() methods.

## See Also

### Methods

- [gState()](appkit/nswindow/gstate().md)
- [canStoreColor()](appkit/nswindow/canstorecolor().md)
- [enableFlushing()](appkit/nswindow/enableflushing().md)
- [disableFlushing()](appkit/nswindow/disableflushing().md)
- [flushIfNeeded()](appkit/nswindow/flushifneeded().md)
- [menuChanged(_:)](appkit/nswindow/menuchanged(_:).md)
- [cacheImage(in:)](appkit/nswindow/cacheimage(in:).md)
- [restoreCachedImage()](appkit/nswindow/restorecachedimage().md)
- [discardCachedImage()](appkit/nswindow/discardcachedimage().md)
- [useOptimizedDrawing(_:)](appkit/nswindow/useoptimizeddrawing(_:).md)
- [init(windowRef:)](appkit/nswindow/init(windowref:).md)
