Storyboards
A storyboard (see Storyboard-Instantiated View Controller) collects, in a single file, multiple view controllers — both parent and children, both presenter and presented. Each view controller is part of a scene, analogous to a nib containing that view controller and any related top-level objects. Special connections are drawn between view controllers; these are of two kinds:
- Relationship
If view controller A has view controller B as its child from the outset (as with a navigation controller and its root view controller, or a tab bar controller and its child view controllers), the connection is a relationship emanating from view controller A. View controllers connected by a relationship are instantiated together: when view controller A is instantiated, view controller B is instantiated along with it, because it is needed immediately.
To draw a relationship in a storyboard, Control-drag from a parent view controller to another view controller. If this is a built-in parent view controller type, the little HUD that appears lets you specify a “Relationship segue.” (This name is misleading, as a parent–child relationship is in no sense a segue.)
- Segue
If view controller B’s view is to be replaced by view controller C’s view at some future time (as with an original presenter and a presented view controller, or a navigation controller’s child and a view controller that will later be pushed onto the stack on top of it), the connection is a segue. View controller C won’t be ...
Get Programming iOS 6, 3rd Edition 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.