Photokit授权

2017-01-16  本文已影响6人  ISwiftUI
// ios 9 以后授权
if ([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusNotDetermined)  {
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status)  {
    if (status == PHAuthorizationStatusAuthorized) {
        // TODO:...
        NSLog(@"用户允许使用相册");
     }
    else if (status == PHAuthorizationStatusDenied ) {
        NSLog(@"用户不允许使用相册");
    }
}];
上一篇下一篇

猜你喜欢

热点阅读