IOS 8 UIImagePickerController for photos only
I am using UIImagePickerController
withsourceType = UIImagePickerControllerSourceTypeCamera;
However, I want to point out that I only want to shoot photos and not videos, (in a custom camera, the user can switch to video) is there a way to do this?
Here is the code I'm using:
if (([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera] == NO))
return ;
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
// Displays a control that allows the user to choose picture or
// movie capture, if both are available:
cameraUI.mediaTypes =
[UIImagePickerController availableMediaTypesForSourceType:
UIImagePickerControllerSourceTypeCamera];
// Hides the controls for moving & scaling pictures, or for
// trimming movies. To instead show the controls, use YES.
cameraUI.allowsEditing = NO;
cameraUI.delegate = self;
[self presentViewController:cameraUI animated:YES completion:nil];
My first guess was to change sourceType = UIImagePickerControllerSourceTypeCamera;
, but the other options are gallery options.
My second guess: modify the array mediaTypes
, but I don't know which one
+3
source to share