Setting the Initial View Controller

Although a storyboard can have many view controllers, each storyboard file has exactly one initial view controller. The initial view controller acts as an entry point into the storyboard. You are going to add and configure another view controller to the canvas and set it to be the initial view controller for the storyboard.

Open Main.storyboard. From the object library, drag a View Controller onto the canvas (Figure 5.3). (To make space on the canvas, you can zoom out by Control-clicking on the background, using the zoom controls at the bottom of the canvas, or using pinch gestures on your trackpad.)

Figure 5.3  Adding a view controller to the canvas

You want this view controller to ...

Get iOS Programming: The Big Nerd Ranch Guide, 6th Edition 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.