Reputation: 399
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
-(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];
}
}
Upvotes: 18
Views: 10482
Reputation: 416
let picker = UIImagePickerController()
picker.delegate = self
picker.allowsEditing = false
picker.automaticallyAdjustsScrollViewInsets = true
picker.sourceType = UIImagePickerControllerSourceType.camera
For both Camera as well as gallery.
If you're using any third party library for editing it will directly guide you to that library or dismiss the picker controller without giving preview.
Upvotes: -3
Reputation: 5448
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.
Upvotes: 10