Informs the view that it’s required to draw content.
In response to receiving one of the display methods, the view recurses down the view hierarchy, sending this message to each of the views that may be involved in the display operation.
Subclasses can override this method to move or resize views, mark additional areas as requiring display, or take other actions that can best be deferred until they are required for drawing. During the recursion, setting the needsDisplay property or sending the setNeedsDisplay(_:) message to views in the hierarchy that are about to be drawn is valid and supported, and affects the assessment of the total area to be rendered in that drawing pass.
The following is an example of a generic subclass implementation: