O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

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

Presenting storyboard view controllers programmatically

In this recipe, we will learn how we can use the storyboard features to programmatically present view controllers within the storyboard.

Getting ready

In this recipe, we will look at how we can programmatically call another view controller within the storyboard by using its identifier.

How to do it…

In order to programmatically determine which view we are in, we will need to create a new UIViewController subclass for our second view controller. This can be achieved by performing the following simple steps:

  1. Select the TwitterExample folder from the project navigator.
  2. Select File | New | File… or press command + N.
  3. Select the Objective-C class template from the list of templates.
  4. Enter SecondViewController ...

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