Я отказал в разрешении камеры, но ранее дал разрешение фотобиблиотеке. Но камера открывается с черным экраном. и я вижу возможность сделать фото. Есть ли способ не открывать камеру.
Мой код такой
-(void)showImagePickerWithSoureType:(UIImagePickerControllerSourceType)type
{
if([UIImagePickerController isSourceTypeAvailable:type])
{
pickerObj = [UIImagePickerController new];
pickerObj.sourceType = type;
UIViewController *topMostViewController = [CommonFunctions getTopMostViewControllerFromRootViewController:[CommonFunctions getAppDelegateObject].window.rootViewController];
dispatch_async(dispatch_get_main_queue(), ^{
[topMostViewController presentViewController:pickerObj animated:YES completion:NULL];
pickerObj.delegate = self;
pickerObj.editing = true;
pickerObj.allowsEditing = true;
});
if([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusNotDetermined)
{
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
switch (status) {
case PHAuthorizationStatusAuthorized:
break;
case PHAuthorizationStatusRestricted:
[self imagePickerControllerDidCancel:pickerObj];
break;
case PHAuthorizationStatusDenied:
[self imagePickerControllerDidCancel:pickerObj];
break;
default:
break;
}
}];
}
}
}