Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Skip Retake/Use Photo option after capturing image by camera in IOS 7

Here I am developing an app using IOS 7 in which camera used to capture the image. but after capturing image it displaying Retake/Use Photo options. i want that after capturing image it directly go to next screen without showing default Retake?use Photo Options.I google out this Issue but I don't get proper solution. Please help me to solve this issue.

Thanks in advance.

Here is the code snippet that i am using in my project

enter image description here

-(void)StartCamera

{

if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

{  

  UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error"           message:@"Device has no camera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];

    [myAlertView show];
}
else
{ 
    picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = NO;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentViewController:picker animated:YES completion:NULL];
}
}
like image 941
Aabasaheb Deshpande Avatar asked May 27 '14 10:05

Aabasaheb Deshpande


1 Answers

The stock UIImagePickerControllerSourceTypeCamera provided by iOS has both these buttons.

One way to achieve what you want is to continue to use UIImagePickerViewController and set showsCameraControls to NO. Then, provide your own user interface using cameraOverlayView for your custom overlay view.

self.picker.showsCameraControls = NO;

self.overlay = [[OverlayViewController alloc] initWithNibName:@"Overlay" bundle:nil];
self.overlay.pickerReference = self.picker;

self.picker.cameraOverlayView = self.overlay.view;
self.picker.delegate = self.overlay;

Another way is to use AVFoundation to create your own camera view.

like image 108
aksh1t Avatar answered Sep 21 '22 01:09

aksh1t