ios原生二维码扫描与生成的实现教程

2020-01-21 07:20:02王振洲

2.保存到本地相册


UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
//获取图片
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
//关闭上下文
UIGraphicsEndImageContext();
completion(image);

/**
* 将图片保存到本地相册
*/
UIImageWriteToSavedPhotosAlbum(image, self , @selector(saveImage:didFinishSavingWithError:contextInfo:), nil);//保存图片到照片库

主要代码贴出来,感兴趣可以去gibHub地址:https://github.com/MrBMask 这里瞅瞅呦

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对ASPKU的支持。


注:相关教程知识阅读请移步到IOS开发频道。