1.先判断手机相册访问权限
⚠️注意:若使用图1如下方式做权限判断,有时status会是PHAuthorizationStatusNotDetermined,因为从iOS11开始,判断权限是异步的,此时建议使用图2中的方法。


2.保存至相册

3.弹出权限申请框

扩展系列文章:
1.将照片保存到相册的三种方法:https://www.jianshu.com/p/bf20733ba19b
2.各个权限功能提示弹框:https://juejin.cn/post/6844903794585632781
3.SDWebImage内部实现及其原理:https://www.jianshu.com/p/8eb060586c1d
4.SDWebImage下载网络图片之提升用户体验:https://www.imgeek.org/article/825307780
网友评论