iOS学习Swift开发

让 Kingfisher 支持 webp 图片

2018-06-12  本文已影响108人  CharlesQiu
  1. 引入 KingfisherWebP 库

pod 'KingfisherWebP'
  1. 添加 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
    
    }
    
上一篇下一篇

猜你喜欢

热点阅读