Every application has a single instance of UIWindow that serves as the container for all the views in the application. The window is created when the application launches. Once the window is created, you can add other views to it.
When a view is added to the window, it is said to be a subview of the window. Views that are subviews of the window can also have subviews, and the result is a hierarchy of view objects with the window at its root.
Once the view hierarchy has been created, it will be drawn to the screen. This process can be broken into two steps:
Figure 4.4 shows another example view hierarchy and the two drawing steps.
Classes like UIButton and UILabel already know how to render themselves to their layers. For instance, in Quiz, you created instances of UILabel and told them what text to display, but you did not have to tell them how to draw text. Apple’s developers took care of that.
Apple, however, does not provide a class whose instances know how to draw concentric circles. Thus, for Hypnosister, you are going to create your own UIView subclass and write custom drawing code.