UI hierarchy and views inheritance

In this chapter, we already talked about UI hierarchies. Let's dive into the topic by introducing the concepts of subview and superview and learning how to build and manage complex hierarchies.

Every instance of UIView (or its subclass) can be connected with other views in a parent-child relationship. The parent view is called superview, while the children are called subviews. A view can only have one superview, but it can contain more than one subview:

UI hierarchy and views inheritance

Thanks to the dedicated UIView properties and functions, you can easily inspect a view hierarchy and navigate from a root view down through to the last view of the ...

Get Learning iOS UI Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.