Welcome to the Treehouse Community
Looking to learn something new?
idk how to do it
The code in the promptForCamera method presents an image picker controller, but it’s broken at the moment. We’d like to specify the source type for the image picker controller so it grabs the image from the camera. Can you fix the code below?
Michael Hulet47,869 Points
You're given a
UIImagePickerController variable named "
controller". You just need to set the property called
sourceType on this
controller variable. The source you want to use is a constant called "
UIImagePickerControllerSourceTypeCamera". This code should work:
controller.sourceType = UIImagePickerControllerSourceTypeCamera;