YouTube

Got a YouTube account?

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

English subtitles

← Dice Example Take Control - UIKit Fundamentals

Get Embed Code
3 Languages

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

  1. Now that you have some experience
    presenting off the shelf
  2. view controllers,
  3. you're probably wondering how to present
    your own custom view controllers.
  4. Here we have an app that
    simulates rolling dice.
  5. The first view controller with
    the roll the dice button,
  6. presents a second view controller
    that displays a roll of the dice.
  7. The second view controller can be
    presented in the same way as the camera
  8. roll or the activity views and
    alert views.
  9. But this time we have full control
    over the displayed view controller.
  10. The app is currently incomplete.
  11. In a second, you'll be asked to download
    it, and look at the Xcode project.
  12. But before we get into the Xcode files,
    let's pause for a second,
  13. to draw the object diagrams for
    the two view controllers.
  14. That way we can clarify
    which IBOutlets and
  15. IBActions the project should contain.
  16. The first view controller is simple.
  17. It's just a single button
    with a single action.
  18. This is the action that should
    trigger the presentation
  19. of the Dice View Controller.
  20. The Dice View Controller
    is slightly more complex.
  21. It needs outlets to these two
    image views that are for the dice.
  22. It also has one button
    with a single action.
  23. This action will cause the view
    controller to be dismissed.
  24. If you look in the instructor notes
    you should see a file called dice.zip.
  25. Go ahead and download that file and
  26. then examine the Dice Xcode Project
    with the following questions in mind.
  27. Check off each question
    as you find the answers.