Return to Video

Add a Navigation Controller - Intro to iOS App Development with Swift

  • 0:00 - 0:04
    The first thing to do here is to select the view controller by clicking on
  • 0:04 - 0:05
    this phone frame.
  • 0:05 - 0:08
    Now, you may have to lean in a little bit to see this tiny blue
  • 0:08 - 0:10
    border around the phone.
  • 0:10 - 0:13
    By the way, I could have done the same thing by opening up Document Outline, and
  • 0:13 - 0:15
    selecting View Controller here.
  • 0:15 - 0:19
    Okay, let me close Document Outline, and get back to my storyboard.
  • 0:19 - 0:22
    Okay so notice that there is an arrow that is pointing to our view controller.
  • 0:22 - 0:25
    Now this arrow means that this is the first or
  • 0:25 - 0:27
    starting view controller of our app.
  • 0:27 - 0:30
    Now you can see more information about this if you slide open
  • 0:30 - 0:31
    the Utilities tray.
  • 0:31 - 0:34
    Tray, and go to Attributes Inspector, and
  • 0:34 - 0:38
    in here you can see an option called Is initial view controller.
  • 0:38 - 0:41
    And that option is checked, which means that this view
  • 0:41 - 0:45
    controller is the initial or the starting view controller for our app.
  • 0:45 - 0:49
    If I uncheck this box, notice that the arrow goes away.
  • 0:49 - 0:52
    Now if I try to run my app, Xcode gives me an error.
  • 0:52 - 0:56
    It says, perhaps the designated entry point is not set.
  • 0:56 - 0:58
    How cultured of you Xcode.
  • 0:58 - 1:01
    Yes, the entry point is in fact not set.
  • 1:01 - 1:04
    To fix this error, all I have to do is check this box again.
  • 1:04 - 1:07
    Alright, I'm going to manage screen space so you can see my
  • 1:07 - 1:12
    story board a little bit better, by sliding out Utility and the debug area.
  • 1:12 - 1:16
    So after I've selected the view controller, I can go to the Editor menu and
  • 1:16 - 1:20
    then select Embed In > Navigation Controller.
  • 1:20 - 1:23
    And voila, we have something new on our screen.
  • 1:23 - 1:27
    Let me use the pen gesture on my mouse pad to align this properly.
  • 1:27 - 1:31
    I can also use the pinch gesture, to zoom in and out of the storyboard.
  • 1:31 - 1:34
    So it seems like the initial view controller has changed.
  • 1:34 - 1:37
    It is now this thing called the Navigation Controller.
  • 1:37 - 1:39
    Navigation controller, as its name suggests,
  • 1:39 - 1:43
    will help us navigate between two different screens on our app.
  • 1:43 - 1:45
    At this point however, I would love for
  • 1:45 - 1:48
    you to search for navigation controller in the documentation.
  • 1:48 - 1:51
    Read through the docs and identify somewhere between one to
  • 1:51 - 1:54
    three things that you've learned about this new idea.
  • 1:54 - 1:56
    Here is your challenge one more time.
  • 1:56 - 1:59
    You can share your ideas with us on the discussion forum, and
  • 1:59 - 2:00
    can check this box when you are done.
Tytuł:
Add a Navigation Controller - Intro to iOS App Development with Swift
Opis:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
UD585 - Intro to iOS App Development with Swift
Duration:
02:01

English subtitles

Revisions Compare revisions