Every application has a single instance of UIWindow that serves as the container for all the views in the application. UIWindow is a subclass of UIView, so the window is itself a view. The window is created when the application launches. Once the window is created, other views can be added 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 (Figure 3.2).
Once the view hierarchy is created, it will be drawn to the screen. This process can be broken into two steps:
Figure 3.3 depicts another example view hierarchy and the two drawing steps.
For WorldTrotter, you are going to create an interface composed of different views. There will be four instances of UILabel and one instance of UITextField that will allow the user to enter a temperature in Fahrenheit. Let’s get started.