カスタムカメラで UIImagePickerController を試しました.アプリケーションが外出するとき、またはサファリを呼び出すときに、カメラのシャッターが開いていないため、次のコードを使用しました.
-(IBAction)cameraAction:(id)sender
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setValue:@"rear" forKey:@"rearcamera"];
[defaults synchronize];
NSLog(@"hai App %@",[defaults valueForKey:@"closeApp"]);
dispatch_async(dispatch_get_main_queue(), ^{
[cameraBut setSelected:NO];
self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
self.picker.showsCameraControls = NO;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;
self.picker.wantsFullScreenLayout = YES;
});
}