YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Navigation and the Stack Data Structure - UIKit Fundamentals

Get Embed Code
3 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. Let's think a little more carefully
    about how the NavigationController is
  2. keeping track of ViewControllers.
  3. A navigation controller has
    a stack of ViewControllers.
  4. Remember that a stack is
    a Last-In-First-Out data structure,
  5. like a stack of cups.
  6. It has two operations.
  7. Items are popped off of the stack,
    and items are pushed onto the stack.
  8. When we start the Settings app,
  9. the top level settings page is
    displayed with the title, Settings.
  10. If we click on Notifications,
  11. a new ViewController gets
    pushed onto the stack.
  12. We can choose to push a number
    of different views next.
  13. Phone, Messages, Passbook.
  14. Now the stack is three
    ViewControllers deep.
  15. We only have one choice
    if we want to pop.
  16. That corresponds to the Back button.
  17. You can see here beside the Back button
    that the navigation bar shows the title
  18. of the next ViewController on the stack.
  19. In this case,
    it's the Settings ViewController.