View Controller Lifecycle
A UIViewController begins its life when it is allocated and sent an initializer message. A view controller will see its view created, moved on screen, moved off screen, destroyed, and created again – perhaps many times over. These events make up the view controller lifecycle.
Initializing view controllers
The designated initializer of UIViewController is initWithNibName:bundle:. This method takes two arguments that specify the name of the view controller’s XIB file inside a bundle. (Remember that building a target in Xcode creates an application bundle; this is the same kind of bundle we’re talking about here.)
Passing nil for both arguments says, “When you load your view, search for a XIB file whose name is the same ...
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