O'Reilly logo

iOS App Development Portable Genius by Richard Wentk

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Swapping Screens

To create an app with multiple screens, begin by creating multiple view controllers. Each should have its own nib file. If your app needs more than two screens, the main controller object is designated the parent controller.

There are three schemes for swapping screens:

bullet_2c.tif Modal screens. These appear temporarily to display optional information such as preferences. When the user has finished with this screen, it disappears and reveals the original view.

bullet_2c.tif Manual screen swaps. You can create as many screens as you need, using whatever logical flow works best for your app. Non-modal screens suggest a permanent change in the state of the app or in the information it displays.

bullet_2c.tif Storyboards. You can use these to sketch out a logical flow, with optional transition animations.

Adding a modal screen

Follow these steps:

1. Create a new Single View Application project. Save it as ModalScreenSwapping.

2. Add some distinctive content to the main nib file. The exact content doesn’t matter.

3. Use the Add File… option to add a new subclass of UIViewController to your project. Check the option that creates a nib file. Save the file as SecondViewController.

4. Add some different distinctive ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required