0.原生和uiwebview都要分别支持.uiwebview难度系数比较大。
1.pod 'SDWebImage/WebP'
fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
据说是vpn。反正开启蓝灯也下载不下来。
2.只通过下载相应两个文件和framework的处理
iOS-WebP 这个中间库也黄了。就剩下两个头文件。没有打包framework
UIImage+WebP.h
UIImage+WebP.m
WebP.framework
https://developers.google.com/speed/webp/download
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html
3.只能这样了。
pod 'SDWebImage/WebP' 下载不成功。也能那两个基础文件给下载下来。
4.添加全局宏 tagert就可以了
Build Settings -- Preprocessor Macros , add SD_WEBP=1
5.原生支持webp处理方案。
最后sdwebimage和libwebp都加入工程 。不加入cocospod。什么都不用修改。就能支持webp的工作。
参考文章:
http://www.amadman.org/blog/webp-in-ios-webview/