iOS 保存图片到相册

 

保存图片到相册

 

- (IBAction)save_clcik:(UIButton *)sender {
    if (self.imgView.image==nil) {
        [SVProgressHUD showWithStatus:@"正在努力加载中..."];
        return;
    }
    
    // 将图片写入到相册()
    UIImageWriteToSavedPhotosAlbum(self.imgView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
    if (error) {
        [SVProgressHUD showErrorWithStatus:@"保存失败!"];
    } else {
        [SVProgressHUD showSuccessWithStatus:@"保存成功!"];
    }
}

 

posted @ 2016-03-03 08:43  人生路1/5  阅读(197)  评论(0)    收藏  举报