Defining Which Scene Is The First To Be Shown

Select the scene and in the Attributes Inspector the "Is Initial View Controller" checkbox.  An incoming arrow will point to that scene to confirm its the first.

Adding A Scene

Drag a "View Controller" object from the Object library panel onto the canvas.

Creating the class code files for a scene (or for multiple scenes aimed at different devices)

Right click the folder into which you want the ViewController .h and .m files to be located and select New File

Cocoa Touch > “Objective-C Class”.  Click Next

Subclass of “UIViewController”

Name the class “SomethingDetailViewController"

UNCHECK “With XIB for user interface”. Click “Next” and save it in the project folder.

Now we need to assign the SomethingViewController class to the storyboard view controller. In the Storyboards editor select the scenes top bar and in the identity inspector, change the class to #SomethingViewController.  If you have a separate storyboard for iPad and iPhone versions (no longer necessary) you can do the same in the other storyboard too.

This has created the view controller class by extending from the UIViewController class. You can now add variables and methods including variables a parent will be able to access for passing data between scenes

In #ViewController.h

@interface SomethingViewController : UIViewController

@property (nonatomic, strong) IBOutlet UILabel *MyLabel;
@property (nonatomic, strong) NSString *SomeString;

In #ViewController.m

@implementation SomethingViewController

@synthesize MyLabel;
@synthesize SomeString;
To Pass Data From A Parent

#import "SomethingViewController.h"
//Do this in the prepareForSegue method:
    SomethingViewController *destViewController = segue.destinationViewController;
    destViewController.SomeString = @"ABCD";
To Pass Data Back To Parent

You need to use a delegate callback – see here

Add a Segue between Scenes

You create a Segue by simply ctrl-dragging (Windows key dragging on a PC keyboard) from one view controller to the next. You either do this by starting a button or other UI element that will trigger the seque, or if you will be calling the segue in code then it’s the ViewController that triggers the segue so CTRL-drag from the scenes bottom bar ViewController icon to the next ViewController.

You can have more than 1 segue (e.g. a button that triggers one, and a programmatic one)

Seque Type

'show' Segue (was 'push')

Adds another View Controller to the navigation stack. This assumes that View Controller that originates the push is part of the same navigation controller that the View Controller that is being added to the stack belongs to.

'present modally' Segue

One View Controller presenting another View Controller modally. The View Controllers don't have to be part of a navigation controller and the View Controller being presented modally is generally considered to be a "child" of the presenting / parent View Controller. A modally presented View Controller usually has no navigation bars or tab bars. The presenting View Controller is also responsible for dismissing the modal View Controller it created and presented.

custom segue

A segue subclass which you define yourself.

Select the segue and give it an identifier if you want to refer to it in code.


Trigger a Segue Programmatically

        [self performSegueWithIdentifier: @"SegueToScene1" 
                  sender: self];
Called Just Before Seque Occurs

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    NSLog(@"Segue is about to occur");

    //If you need to detect which seque is being triggered:
    //if ([segue.identifier isEqualToString:@"MySequeIdentifier"])
    //    SomethingViewController *destViewController = segue.destinationViewController;
    //    destViewController.SomeString = @"ABCD";