NSData * data = [NSData dataWithContentsOfURL:[NSURL URLWithString:_saveImgUrl]];
shareView.saveblock= ^{
if([StarCustomUtilcheckPhotoAuthority]) {
if(@available(iOS9, *)) {
[[PHPhotoLibrarysharedPhotoLibrary]performChanges:^{
[PHAssetChangeRequestcreationRequestForAssetFromImage:[UIImageimageWithData:data]];
}completionHandler:^(BOOLsuccess,NSError*_Nullableerror) {
dispatch_async(dispatch_get_main_queue(), ^{
if(error) {
[GDHUDUtilshowTextInWindow:@"保存图片失败"];
}else{
[GDHUDUtilshowTextInWindow:@"保存图片成功"];
}
});
}];
}
else{
UIImageWriteToSavedPhotosAlbum([UIImageimageWithData:data],self,@selector(image:didFinishSavingWithError:contextInfo:),nil);
}
}
};