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

# needsLayout

A Boolean value indicating whether the view needs a layout pass before it can be drawn.

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

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the view needs a layout pass, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

You only ever need to change the value of this property if your view implements the [`layout()`](/documentation/AppKit/NSView/layout()) method because it has custom layout that is not expressible in the constraint-based layout system. Setting this property to <doc://com.apple.documentation/documentation/Swift/true> lets the system know that the view’s layout needs to be updated before it is drawn. The system checks the value of this property prior to applying constraint-based layout rules for the view.

---

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)