Interacting with View Controllers and Their Views
Let’s look at some methods that are called during the lifecycle of a view controller and its view. Some of these methods you have already seen, and some are new.
-
init(coder:) is the initializer for UIViewController instances created from a storyboard.
When a view controller instance is created from a storyboard, its init(coder:) is called once. You will learn more about this method in Chapter 13.
-
init(nibName:bundle:) is the designated initializer for UIViewController.
When a view controller instance is created without the use of a storyboard, its init(nibName:bundle:) is called once. Note that in some apps, you may end up creating several instances of the same view ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access