The App Life Cycle

If someone asked us to point to the first line of our app, what would we say? Unlike old C programs—or even the Objective-C that we used prior to iOS 8—there’s no command-line friendly main function that kicks off our execution. If we think back to where started, we had just two classes: AppDelegate and ViewController, along with Main.storyboard. Clearly, we’re not driving this car; we’re a passenger. So let’s start by getting a sense of where iOS is taking us when our app starts up and when we get an opportunity to tell the driver where we’re going.

For a Swift app, iOS creates a UIApplication object to set up the app’s runtime environment: its use of the display, its ability to handle touches and rotation events, and so ...

Get iOS 9 SDK Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.