<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/flush()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)flushWindow"
  },
  "title" : "flush()"
}
-->

# flush()

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

```
func flush()
```

## Discussion

Does nothing for other display devices, such as a printer. This method is automatically invoked by the `NSWindow`  [`display()`](/documentation/AppKit/NSWindow/display()) and [`displayIfNeeded()`](/documentation/AppKit/NSWindow/displayIfNeeded()) methods and the corresponding [`NSView`](/documentation/AppKit/NSView) [`display()`](/documentation/AppKit/NSView/display()) and [`displayIfNeeded()`](/documentation/AppKit/NSView/displayIfNeeded()) methods.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)