Kingfisher 找不到 setImageWithURL 的方法,可使用以下方法代替
ImageView.kf.setImage(with: URL.init(string: url), placeholder: UIImage.init(named: "img"), options: nil, progressBlock: nil, completionHandler: { (image, error, cacheType, imageURL) in
estImageView.image = image
})
获取不到网络数据,提示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.
解决办法如下:
1,在Info.plist中添加 NSAppTransportSecurity (显示App Transport Security Settings可通过点击右键,选择“show raw keys/value”)类型 Dictionary ;
2,在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES;