---
title: needsLayout
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsview/needslayout
---

# needsLayout

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

## Declaration

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

## Return Value

Return Value true if the view needs a layout pass, false otherwise.

## Discussion

Discussion You only ever need to change the value of this property if your view implements the layout() method because it has custom layout that is not expressible in the constraint-based layout system. Setting this property to 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.

## See Also

### Triggering Auto Layout

- [layout()](appkit/nsview/layout().md)
- [layoutSubtreeIfNeeded()](appkit/nsview/layoutsubtreeifneeded().md)
- [needsUpdateConstraints](appkit/nsview/needsupdateconstraints.md)
- [updateConstraints()](appkit/nsview/updateconstraints().md)
- [updateConstraintsForSubtreeIfNeeded()](appkit/nsview/updateconstraintsforsubtreeifneeded().md)
