// ios 9 以后授权
if ([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusNotDetermined) {
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {
// TODO:...
NSLog(@"用户允许使用相册");
}
else if (status == PHAuthorizationStatusDenied ) {
NSLog(@"用户不允许使用相册");
}
}];
网友评论