setNeedsDisplay(_:)
Marks the region of the view within the specified rectangle as needing display, increasing the view’s existing invalid region to include it.
Declaration
func setNeedsDisplay(_ invalidRect: NSRect)Parameters
- invalidRect:
The rectangular region of the view to mark as invalid; it should be specified in the coordinate system of the view.
Discussion
A later displayIfNeeded method will then perform drawing only within the invalid region. View objects marked as needing display are automatically redisplayed on each pass through the application’s event loop. (View objects that need to redisplay before the event loop comes around can of course immediately be sent the appropriate display method.)