English subtitles

← Launch Image Picker and Activity View - UIKit Fundamentals

Get Embed Code
3 Languages

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

  1. Now we're going to set
    up a simple project, so
  2. we can experiment with presenting
    stock view controllers.
  3. You're probably familiar with views like
    the Camera Roll, Activity Views, and
  4. Alert Views.
  5. These are off the shelf view controllers
    which we'll present without modifying
  6. Apple's code.
  7. To get some practice with presenting
    off the shelf view controllers,
  8. we'll make a one button app
    with a method named experiment,
  9. which presents one of
    Apple's view controllers.
  10. It'll look something like this.
  11. One button which presents
    the camera roll, and
  12. the experiment method will
    look something like this.
  13. In this method we'll need a reference
    to the view controller we're
  14. about to present.
  15. So how will we get that
    view controller reference?
  16. We'll just make one.
  17. So here we invoke the constructor for
    the view controller required to select
  18. an image, and then in this line,
    we present the image picker.
  19. Now see if you can repeat
    this experiment on your own.
  20. Just create a single view project
    with a button labeled Present, and
  21. then connect that button to
    an action named experiment.
  22. If you get stuck, consult
    the steps in the instructor notes.
  23. But first try to complete
    it without peeking.
  24. Again, your app should
    look something like this.
  25. When you're finished,
  26. describe your level of confidence
    working through this exercise.