UIStoryboard is a valuable tool to iOS development. The intent of this presentation is to help you understand the basics of storyboarding. For more details on best practices, check out my blog here: http://robsprogramknowledge.blogspot.com/2012/01/uistoryboard-best-practices.html.
2. What is a storyboard?
A collection of views and the transitions between them.
May contain all the views in an app or a subset.
A necessity for rapid UI development.
Great for prototyping.
A picture is worth a thousand lines of code.
3. How do UIStoryboards
compare to XIBs?
UIStoryboard: XIB:
Interface Builder Interface Builder
IBOutlets/IBActions IBOutlets/IBActions
Segues
Static cells
Prototype cells
4. What is a segue?
Not the cool, two-wheeled mobility device invented by
Dean Kamen.
A transition from one view controller to another.
Alternatively can present a popover.
5. -prepareForSegue:sender:
Called on the source view controller before the
transition happens.
The segue keeps track of the destination view
controller.
Use this method to pass data on to the destination
view controller.
6. How do I get data back?
Delegate
Block
Notification center
Observer
Shared data
7. Types of segues
Push
Modal
All standard modal transitions are supported.
Popover (iPad only)
Custom
Any transition you want.
8. Static cells
Used for table views that always look the same.
No need for a UITableViewDataSource nor a
UITableViewDelegate.
May eliminate the need for a UITableViewController
subclass.
9. Prototype cells
Custom UITableViewCells associated with a
UITableView.
Makes it easy to create and use custom cells.
Usually requires a custom cell class.
May eliminate the need for a UITableViewDelegate.
10. Other advantages
Keeps similar views together.
Gives a bird’s eye view of the app.
Makes the view hierarchy easier to analyze.
Saves a lot of coding.