Contents

needsDisplay

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

Declaration

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 false when the view is up to date.

Whenever the data or state affecting the view’s appearance changes, set this property to 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.

See Also

Invalidating the View’s Content