An object that manages a view hierarchy for your UIKit app.
Declaration
class UIViewController : UIResponder
Overview
The UIViewController class defines the shared behavior that is common to all view controllers. You rarely create instances of the UIViewController class directly. Instead, you subclass UIViewController and add the methods and properties needed to manage the view controller's view hierarchy.
A view controller’s main responsibilities include the following:
-
Updating the contents of the views, usually in response to changes to the underlying data.
-
Responding to user interactions with views.
-
Resizing views and managing the layout of the overall interface.
-
Coordinating with other objects—including other view controllers—in your app.
A view controller is tightly bound to the views it manages and takes part in handling events in its view hierarchy. Specifically, view controllers are UIResponder objects and are inserted into the responder chain between the view controller’s root view and that view’s superview, which typically belongs to a different view controller. If none of the view controller’s views handle an event, the view controller has the option of handling the event or passing it along to the superview.
View controllers are rarely used in isolation. Instead, you often use multiple view controllers, each of which owns a portion of your app’s user interface. For example, one view controller might display a table of items while a different view controller displays the selected item from that table. Usually, only the views from one view controller are visible at a time. A view controller may present a different view controller to display a new set of views, or it may act as a container for other view controllers’ content and animate views however it wants.
Apple Developer Documentation
developer.apple.com
'Programming > Udacity Nano Degree - iOS Developer' 카테고리의 다른 글
Unexpectedly found nil while implicitly unwrapping an optional value (0) | 2020.10.22 |
---|---|
Class: UISwitch (0) | 2020.10.22 |
Connecting the Stop Recording Button (0) | 2020.10.19 |
From Code to UI Element (0) | 2020.10.19 |
Pitch Perfect - Adding Code for the Button (0) | 2020.10.19 |