Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The “Hello, Window!” example showed the very minimal code needed to construct and display a window/view pair. Because the UIView class itself is merely a base class, it didn’t actually display anything. To create a useful application, a new class can be derived from UIView, allowing its methods to be overridden to add functionality. This controlling view can then display other objects, such as text boxes, images, and so on.
To derive a subclass from UIView, write a new interface and implementation declaring the subclass. The following snippet creates a subclass named MainView: