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

# displayIfNeeded()

Passes a display message down the window’s view hierarchy, thus redrawing all views that need displaying.

## Declaration

```swift
func displayIfNeeded()
```

## Discussion

Discussion This method includes the frame view that draws the border, title bar, and other peripheral elements. It’s useful when you want to modify some number of views and then display only the ones that you modified. You rarely need to invoke this method. NSWindow objects normally record which of their views need displaying and display them automatically on each pass through the event loop.

## See Also

### Drawing Windows

- [display()](appkit/nswindow/display().md)
- [viewsNeedDisplay](appkit/nswindow/viewsneeddisplay.md)
- [allowsConcurrentViewDrawing](appkit/nswindow/allowsconcurrentviewdrawing.md)
