代码改变世界

ios - 图片保存到相册

2018-05-25 12:52  菜鸟Alex  阅读(226)  评论(0编辑  收藏  举报
  • 在info.plist中添加权限声名否则崩溃 Privacy - Photo Library Additions Usage Description
- (void)loadImageFinished:(UIImage *)image
{
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
    
    NSLog(@"image = %@, error = %@, contextInfo = %@", image, error, contextInfo);
}