Search code examples
iosobjective-cuiimagepickercontroller

How to show all camera controls with/for UIImagePickerController?


I have trouble showing the camera controls when using UIImagePickerController. Specifically, I need to be able to select between slo-mo, video, photo, square and pano.

The essential part of code I use is:

UIImagePickerController *pc = [[UIImagePickerController alloc] init];
[pc setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
pc.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, nil];

But this shows a picker controller with the ability to take a picture only i.e., no square nor pano modes either.

Setting pc.mediaTypes to:

pc.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie, nil];

..shows a picker controller with video and photo. But how do I get the other camera modes/types to show? E.g. what is the UTType for pano?


Solution

  • UIImagePickerController doesn't give you Apple's whole Camera app to use inside of your own app. Not all of the functionality of the Camera app is available. You can print available media types by calling -[UIImagePicker availableMediaTypesForSourceType:] and you'll find that you get kUTTypeImage and kUTTypeMovie.

    Square, slo-mo, time-lapse, and panorama functionalities are not provided by UIImagePickerController.