标题:
iOS截屏(视频黑色)并保存到自定义相册(3)
[打印本页]
作者:
look_w
时间:
2019-2-19 14:55
标题:
iOS截屏(视频黑色)并保存到自定义相册(3)
3.保存到系统相册
// UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo
,nil);//保存到系统相册
//- (void)image
UIImage *)image didFinishSavingWithError
NSError *)error contextInfo
void *)contextInfo {
// if (error == nil) {
// NSLog(@"保存成功");
// [QYprogressHUD showSuccessWithStatus
"截图以保存到相册"];
// } else {
// NSLog(@"失败");
// [QYprogressHUD showErrorWithStatus
"截图失败"];
// }
//}
4.知识点补充
4.1首次判断相册权限
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
if (status == PHAuthorizationStatusNotDetermined) {
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {//同意
[weakSelf canSaveImg:image];
return ;
}else
{
[QYprogressHUD showInfoWithStatus
"未获得相册权限,截屏保存失败"];
return ;
}
}];
}
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0