<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/needsDisplay",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(py)needsDisplay"
  },
  "title" : "needsDisplay"
}
-->

# needsDisplay

A Boolean value that determines whether the view needs to be redrawn before being displayed.

```
var needsDisplay: Bool { get set }
```

## Discussion

The `displayIfNeeded` methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to <doc://com.apple.documentation/documentation/Swift/false> when the view is up to date.

Whenever the data or state affecting the view’s appearance changes, set this property to <doc://com.apple.documentation/documentation/Swift/true>. This marks the view as needing to update its display. On the next pass through the app’s event loop, the view is automatically redisplayed.

---

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)