UIImagePickerViewController无法激活iOS11的专辑权限,但可以加载照片和视频

时间:2017-09-14 12:18:16

标签: ios uiimagepickercontroller

为什么UIPickerView可以在没有iOS11许可的情况下加载照片和视频? 似乎没有任何权限警告popover。

iOS11 - GM xcode9 beta 4

新的空白应用:

#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>

@interface ViewController () <UINavigationControllerDelegate,UIImagePickerControllerDelegate>

@end

@implementation ViewController

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
     UIImagePickerController *vc = [[UIImagePickerController alloc] init];
     UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
     UIImagePickerController *picker = [[UIImagePickerController alloc] init];
     picker.delegate = self;
     picker.allowsEditing = YES;
     picker.sourceType = sourceType;
     vc.delegate = self;
     [self presentViewController:vc animated:YES completion:nil];
} 

它可以轻松访问照片库而无需任何警报,您甚至可以加载照片来设置背景。 这是一个系统杠杆错误?或者我做错了什么?

ps:已经设置了以下信息:

NSPhotoLibraryAddUsageDescription

NSPhotoLibraryUsageDescription

photo

1 个答案:

答案 0 :(得分:0)

只有一次请求许可。如果一旦你允许它,那么你每次都不会得到那个警报。所以,如果你想再次检查它,然后删除你的应用程序并重新安装它,你会发现要求许可的警报!

相关问题