iOS开发笔记-90:Swift5 - kingfisher 下载图片UIImage

import Kingfisher
//旧版本
ImageDownloader.default.downloadImage(with: urlStr.url!, retrieveImageTask: nil, options: nil, progressBlock: nil) { (image, error, url, _) in
            weakself?.bankBtn.setImage(image, for: .normal)
        }
swift5.0
KingfisherManager.shared.retrieveImage(with: urlStr.url!) { result in
            let image = try? result.get().image
            if let image = image {

            }
        }


推荐阅读更多精彩内容