5.1. Creating a Project with Storyboards

Problem

In Xcode, you want to create a project that uses Storyboards.

Solution

Choose the Use Storyboard option in the New Project setting dialog (Figure 5-1) and make your app a universal app.

The Use Storyboard option of New Project dialog

Figure 5-1. The Use Storyboard option of New Project dialog

Discussion

If you want to create a project that uses storyboards, simply follow these steps:

  1. In Xcode, select the File menu and then New New Project...

  2. In the New Project dialog, make sure the iOS main category is selected and select the Application subcategory under iOS. Once that is done, on the right side, select Single View Application and press Next, as shown in Figure 5-2.

  3. Now select a product name and make sure your app is a Universal app. Apple wants developers to start writing universal apps whenever they can, in order for iPad users to also enjoy the same apps that iPhone and iPod touch users have access to. In this dialog, make sure you have checked the User Storyboards checkbox, as shown in Figure 5-3. After you are done, press Next.

  4. You will now be asked to save your project in a folder. Once you are done, press the Create button (see Figure 5-4) and now you have a project that uses storyboards.

Now if you have a look at the files that Xcode has created for you (see Figure 5-5), you’ll notice two files whose names end with .storyboard. Xcode, because this is a universal app, created a storyboard ...

Get iOS 6 Programming Cookbook 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.