让 Kingfisher 支持 webp 图片
2018-06-12 本文已影响108人
CharlesQiu
-
引入 KingfisherWebP 库
pod 'KingfisherWebP'
-
添加 options
[.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)]
self.kf.setImage(with: URL(string: string), placeholder: placeholder, options: [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)]) { (img, err, cacheType, imgUrl) in }