needsLayout
A Boolean value indicating whether the view needs a layout pass before it can be drawn.
Declaration
var needsLayout: Bool { get set }Return Value
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.