相册权限–iOS 8.0之后
导入头文件@import Photos;
检查是否有相册权限
PHAuthorizationStatus photoAuthorStatus = [PHPhotoLibrary authorizationStatus];
switch (photoAuthorStatus) {
case PHAuthorizationStatusAuthorized:
NSLog(@"Authorized");
break;
case PHAuthorizationStatusDenied:
NSLog(@"Denied");
break;
case PHAuthorizationStatusNotDetermined:
NSLog(@"not Determined");
break;
case PHAuthorizationStatusRestricted:
NSLog(@"Restricted");
break;
default:
break;
}
![Uploading 144446-b8aca7ba38c5f8c0_695906.png …]获取相册权限
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {
NSLog(@"Aut