//保存图片的方法
- (IBAction)save {
//将图片写入相册
// Adds a photo to the saved photos album. The optional completionSelector should have the form:(官方提示你使用下面的方法来检测保存是否成功)
// - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
UIImageWriteToSavedPhotosAlbum(self.imageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
if (error) {
[SVProgressHUD showErrorWithStatus:@"保存失败!"];
}else {
[SVProgressHUD showSuccessWithStatus:@"保存成功!"];
}
}
如何把图片存储到相册簿
最新推荐文章于 2024-09-14 16:14:53 发布