美文网首页iOS学习Swift开发
让 Kingfisher 支持 webp 图片

让 Kingfisher 支持 webp 图片

作者: CharlesQiu | 来源:发表于2018-06-12 11:59 被阅读108次
  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
    
    }
    

相关文章

网友评论

    本文标题:让 Kingfisher 支持 webp 图片

    本文链接:https://www.haomeiwen.com/subject/yiuleftx.html