O'Reilly logo

iOS 5 Programming Cookbook by Vandad Nahavandipoor

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

4.0. Introduction

iOS programmers are all used to view controllers by now. We know how to use navigation controllers in order to push and pop view controllers. But Apple believes this can be done more easily, and that’s the whole story behind storyboards. Storyboarding is the new way of defining the connection between different screens in your app. For instance, if you have 20 unique view controllers in your app that you coded a year ago and are looking at the source code again now, you will need to find your way around the connections between these view controllers, and to try to remember what view controller is pushed when a certain action is taken by the user. This can be very difficult, especially if you have not documented your code. Storyboards come to the rescue. With storyboards, you can now view/create your entire app’s UI and the connections between view controllers in one screen. It’s that simple.

To take advantage of storyboarding, you need to get acquainted with Interface Builder. Don’t worry; it’s all covered in this chapter.

With storyboards, one screen’s worth of content is called a scene. The relation between a scene and a storyboard on the iPhone can be compared to a view and a view controller. In a scene, you put all your content on the screen to be presented to the user at the same time. On the iPad, more than one scene can be presented to the user at the same time because of the bigger screen.

Storyboarding supports transitioning from one scene to another. The equivalent of a navigation controller pushing one view controller on top of another is a segue in storyboarding. Another type of transition is a modal view controller that slides a scene from the bottom of the screen up to fill the screen temporarily. On the iPad, modal screens usually appear in the center of the screen and dim the rest of the screen, to point out that they are the main input at that moment.

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