UIImagePickerControllerDelegate
#pragma mark - 相册
- (void)openPhotoVC{
//判断是否有相机权限
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
if (status == PHAuthorizationStatusRestricted || status == PHAuthorizationStatusDenied) {
//无权限
[ccs showNotice:@"无相册访问权限"];
return;
}
UIImagePickerController *pickerC = [[UIImagePickerController alloc]init];
pickerC.delegate = self ;
pickerC.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerC.modalPresentationStyle = UIModalPresentationFullScreen;
[self.viewController presentViewController:pickerC animated:YES completion:nil];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
// 获取图片
UIImage *image = info[UIImagePickerControllerOriginalImage];
}
网友评论