Setting Up the Picker

You instantiate a camera version of the image picker the same way you create a picture selection one. Just change the source type from the library or Camera Roll to the camera:

picker.sourceType =  UIImagePickerControllerSourceTypeCamera;

As with other modes, you can allow or disallow image editing as part of the photo-capture process by setting the allowsEditing property.

Although the setup with UIImagePickerControllerSourceTypeCamera is the same as with UIImagePickerControllerSourceTypePhotoLibrary, the user experience differs slightly (see Figure 8-2). The camera picker offers a preview that displays after the user taps the camera icon to snap a photo. This preview lets users retake the photo ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.