SDWebImage支持WebP

Podfile 添加以下git

更新完成后 github

设置 Build Settings 下 Preprocessor Macrosweb

add SD_WEBP=1json

使用ui

[self.imageView1 sd_setImageWithURL:[NSURL URLWithString:url]];url

self.imageView2.image = [UIImage sd_imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];3d

pod 'SDWebImage/WebP'cdn

终端执行 pod repoblog

在本地库中, 并找到对应的libwebp版本的文件 执行命令find ~/.cocoapods/repos/master -iname libwebp

拿到上面的路径,前往文件夹(command+shift+G)~/.cocoapods/repos/master/Specs/1/9/2/libwebpit

用哪个版本进入那个版本的文件夹

打开libwebp.podspec.json文件

将其中homepage改成https://github.com/webmproject/,source->git改成https://github.com/webmproject/libwebp.git/ 把source - git中的url更换成https://github.com/webmproject/libwebp.git

保存成功 删除pod文件夹从新pod install。

相关文章
相关标签/搜索