在需要的地方添加下面的方法
UIImageWriteToSavedPhotosAlbum(image, weakSelf,@selector(imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:),nil);
下面的方法为保存失败还是成功的回调
<span style="color:#ff0000;">- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
if (!error)
{
[MBProgressHUDshowSuccsessHUDAddedToWindowWithSuccessStr:@"保存成功"animated:YESshowTime:1.0];
}
else
{
[MBProgressHUDshowErrorHUDAddedToWindowWithErrorStr:@"保存失败"animated:YESshowTime:1.0];
}
}</span>