iOS Lec #09: Understanding Views and View Hierarchy
The document discusses views and view hierarchies in iOS. It explains that views define visual and interactive areas on screen and are organized in a parent-child hierarchy with the UIWindow at the top. It describes common view types like controls, labels, images, containers, navigation bars and alerts. It also explains that views are subclasses of UIView and the UIWindow provides the surface for displaying the view hierarchy.
We take content rights seriously. If you suspect this is your content, claim it here.
0 ratings0% found this document useful (0 votes)
87 views15 pages
iOS Lec #09: Understanding Views and View Hierarchy
The document discusses views and view hierarchies in iOS. It explains that views define visual and interactive areas on screen and are organized in a parent-child hierarchy with the UIWindow at the top. It describes common view types like controls, labels, images, containers, navigation bars and alerts. It also explains that views are subclasses of UIView and the UIWindow provides the surface for displaying the view hierarchy.
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 15
iOS Lec #09
Understanding Views and View
Hierarchy Overview Views are visual objects that are assembled to create the user interface of an iOS application. They essentially define what happens within a specified rectangular area of the screen, both visually and in terms of user interaction. Cont.. • All views are subclasses of the UIKit UIView class and include items such as the label (UILabel) and image view (UIImageView) and controls such as the button (UIButton) and text field (UITextField). Another type of view that is of considerable importance is the UIWindow class. UIWindow • The UIWindow class provides the surface on which the view components are displayed. In iOS app typically only has one window, the window must fill the entire screen and it lacks the title bar we’ve come to expect on desktop applications. The UIWindow • The backdrop for your app’s user interface and the object that dispatches events to your views. • A window handles the overall presentation of your app’s user interface The View Hierarchy • iPhone iOS user interfaces are constructed using a hierarchical approach whereby different views are related through a parent/child relationship. • At the top of this hierarchy sits the UIWindow object. The View Hierarchy: The view hierarchy Types of View • The Window • Container Views • Controls • Text and Web Views • Alert Views • Navigation Views and Tab Bars ... etc The Window • The UIWindow is the root view of the view hierarchy and provides the surface on which all subviews draw their content. Container Views: • Container view controllers are a way to combine the content from multiple view controllers into a single user interface Controls • The controls category encompasses views that both present information and respond to user interaction. Control views inherit from the UIControl class (itself a subclass of UIView) and include items such as buttons, sliders and text fields. Display Views: • Display views are similar to controls in that they provide visual feedback to the user, the difference being that they do not respond to user interaction. Examples of views in this category include the UILabel and UIImageView classes. Text and Web Views The UITextView and UIWebView classes both fall into this category and are designed to provide a mechanism for displaying formatted text to the user. The UIWebView class, for example, is designed to display HTML content formatted so that it appears as it would if loaded into a web browser. Navigation Views and Tab Bars Navigation views and tab bars provide mechanisms for navigating through an application user interface. They work in conjunction with the view controller and are typically created from within Interface Builder. Alert Views Views in this category are designed specifically for prompting the user with urgent or important information together with optional buttons to call the user to action.