//---------- viewController.h file has
IBOutlet UIView *viewCamera; // custom view for taking camera reason
//------------viewController.m :: inside viewDidLoad method
// -- camera start
[viewCamera setBackgroundColor:[UIColor clearColor]];
imgPicker = [UIImagePickerController new];
imgPicker.allowsEditing = YES;
imgPicker.delegate = self;
imgPicker.cameraOverlayView = viewCamera;
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:imgPicker animated:NO completion:nil];
// ----- ob btn clicked
- (IBAction)btnTakePhotoPressed:(id)sender{
[imgPicker takePicture];
}
この行が原因でアプリがクラッシュします。この行のコードが実行されているとコメントすると、カメラがフル ビューで開いている場合、カスタム ビューにカメラ アクセスを追加したいと考えています。
imgPicker.cameraOverlayView = viewCamera;
前もって感謝します :)