1. init(coder:) 它是视图控制器从故事板创建实例的默认初始化函数.(It is the initializer for UIViewController instances created from a storyboard.) 它在整个生命周期中只被调用1次. 2. init(nibName:bundle:) 它是视图控制器的指定初始化函数. (It is the designated initializer for UIViewController.) 当视图控制器的实例不是通…
Creating Custom Content View Controllers 创建自定义内容视图控制器 Custom content view controllers are the heart of your app. You use them to present your app’s unique content. All apps need at least one custom content view controller. Complex apps divide the wor…
Parent-child relationshipsParent-child relationships are formed when using view controller containers. Examples of viewcontroller containers are UINavigationController, UITabBarController, and UISplitViewController. You can identify a view controller…
View Controller Basics 视图控制器基础 Apps running on iOS–based devices have a limited amount of screen space for displaying content and therefore must be creative in how they present information to the user. Apps that have lots of information to display…
Responding to Display-Related Notifications 响应跟显示相关的通知 When the visibility of a view controller’s view changes, the view controller calls some built-in methods to notify subclasses of the changes. You can override these methods to override how your s…
Resource Management in View Controllers View controllers are an essential part of managing your app’s resources. View controllers allow you to break your app up into multiple parts and instantiate only the parts that are needed. But more than that, a…
Using View Controllers in Your App Whether you are working with view controllers provided by iOS, or with custom controllers you’ve created to show your app’s content, you use a similar set of techniques to actually work with the view controllers. 不管…
View Controller Basics Apps running on iOS–based devices have a limited amount of screen space for displaying content and therefore must be creative in how they present information to the user. Apps that have lots of information to display must there…