使用SDWebImage加载“http://”开头的图片报错,错误如下:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
找查资料后发现,iOS新特性要求App内访问网络请求,要采用 HTTPS 协议。
解决办法如下:
在Info.plist文件中添加"App Transport Security Settings", Type设为"Dictionary",再添加"Allow Arbitray Loads", Type 设为"Boolean",“Value”为“YES”即可。