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。

相關文章
相關標籤/搜索