Lecture 6

Lecture 6 - Stanford CS193p Developing Applications for iOS...

Info iconThis preview shows pages 1–17. Sign up to view the full content.

View Full Document Right Arrow Icon
Stanford CS193p Fall 2011 Developing Applications for iOS Fall 2011 Stanford CS193p
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 To day Demo continuation Delegating the View’s data (its smileyness) Adding a gesture recognizer to the View (and handled by the Controller) that modi±es the Model View Controllers Multiple MVCs Segues UINavigationController Demo Friday Getting your application running on a device
Background image of page 2
Stanford CS193p Fall 2011 View Controller Hopefully you’ve got a pretty good handle on the basics of this! Your Controller in an MVC grouping is always a subclass of UIViewController . It manages a View (made up of subviews that you usually have some outlets/actions to/from). It is the liaison between that View and the Model (which is UI-independent). So how do we grow our application to use multiple MVCs? We need infrastructure to manage them all. That’s what storyboards and “controllers of controllers” are all about.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 MVCs working together What happens when your application gets more features? Now all of your UI can’t Ft in one MVC’s view.
Background image of page 4
Stanford CS193p Fall 2011 MVCs working together What happens when your application gets more features? We never have an MVC’s view span across screens. So we’ll have to create a new MVC for these new features.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 MVCs working together So how do we switch the screen to show this other MVC?
Background image of page 6
Stanford CS193p Fall 2011 UINavigationController MVCs working together We use a “controller of controllers” to do that. For example, a UINavigationController .
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 UINavigationController MVCs working together The UINavigationController is a Controller whose View looks like this.
Background image of page 8
Stanford CS193p Fall 2011 UINavigationController MVCs working together rootViewController But it’s special because we can set its rootViewController outlet to another MVC . ..
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 UINavigationController MVCs working together ... and it will embed that MVC’s View inside its own View.
Background image of page 10
Stanford CS193p Fall 2011 UINavigationController MVCs working together Then a UI element in this View (e.g. a UIButton ) can segue to the other MVC and its View will now appear in the UINavigationController .
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 UINavigationController MVCs working together
Background image of page 12
Stanford CS193p Fall 2011 UINavigationController MVCs working together Notice this Back button automatically appears.
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 UINavigationController MVCs working together When we click it, we’ll go back to the frst MVC.
Background image of page 14
Stanford CS193p Fall 2011 UINavigationController MVCs working together
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Stanford CS193p Fall 2011 Segues Let’s talk about how the segue gets set up ±rst Then we’ll look at how we create a UINavigationController in our storyboard.
Background image of page 16
Image of page 17
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2012 for the course CS 193P taught by Professor Evandoll during the Fall '09 term at Stanford.

Page1 / 39

Lecture 6 - Stanford CS193p Developing Applications for iOS...

This preview shows document pages 1 - 17. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online