All About Views and UIView

All of the “stuff” you see and interact with in an app are called views. Each distinct screen is made of dozens of views, from tiny icons to buttons and text entry fields. The base view of an app is called the window, and all other views exist within it. Apps can even have multiple windows, but that’s a little bit beyond our scope.

In code, views are UIView objects; all graphics on the screen are descendants of UIView. The window is a subclass of UIView called UIWindow. When our app starts, we set up a window and then begin adding new views to it. These additional views are known as subviews.

Subviews are visually stacked on top of each other within the parent view. Every view, not just the window, can have subviews. ...

Get RubyMotion 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.