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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.