For your implementation file:
- (IBAction)TakePicture:(id)sender { // Create image picker controller UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; // Set source to the camera imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; // Delegate is self imagePicker.delegate = self; OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; // Insert the overlay: imagePicker.cameraOverlayView = overlay; // Allow editing of image ? imagePicker.allowsImageEditing = YES; [imagePicker setCameraDevice: UIImagePickerControllerCameraDeviceFront]; [imagePicker setAllowsEditing:YES]; imagePicker.showsCameraControls=YES; imagePicker.navigationBarHidden=YES; imagePicker.toolbarHidden=YES; imagePicker.wantsFullScreenLayout=YES; self.library = [[ALAssetsLibrary alloc] init]; // Show image picker [self presentModalViewController:imagePicker animated:YES]; }
Create a UIView class and add this code
- (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) {
raj Nov 06 2018-12-12T00: 12Z
source share