Podfile 添加如下
更新完成后
设置 Build Settings 下 Preprocessor Macros
add SD_WEBP=1
使用
[self.imageView1 sd_setImageWithURL:[NSURL URLWithString:url]];
self.imageView2.image = [UIImage sd_imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];
pod 'SDWebImage/WebP'
终端执行 pod repo
拿到上面的路径,前往文件夹(command+shift+G)~/.cocoapods/repos/master/Specs/1/9/2/libwebp
保存成功 删除pod文件夹重新pod install。