In my app I'm allowing the user to select if they want to choose a photo from the library, use the camera to take a photo, or use the camera to record a video.
After a photo has been selected or taken with the Camera, tapping Use will dismiss the UIImagePickerController and take the user to a new UIViewController.
I want to do the same for when a user records a video. Right now if the user taps the 'Use' button it just dismisses the picker.
How do I detect if the picker is set to record video?
Here's what I have tried:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
if (picker.mediaTypes == [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera] && picker.cameraCaptureMode == UIImagePickerControllerCameraCaptureModeVideo)
{
// Push to new view controller
// dismiss the picker
}
}
Is it possible to do this? What should I check for?
Thanks!