暂时只实现了原生显示。
方法是:用SDWebImage 的demo build出一个SDwebImage.Framework
然后导入到原工程。
只能适配到ios8. ios7好像不兼容。
另外,sdwebimagecache 这一块会在打包的时候出现问题。
我的做法是重写该方法。
暂时先这样吧
后面可能要做webview上显示webp.
2018.1.12 还是有bug。
上面只能在模拟器上跑,真机上跑一直有错:
2018-01-12 14:06:04.171044+0800 wepdemo2[1435:503032] -[UIImageView sd_setImageWithURL:]: unrecognized selector sent to instance 0x103e887a0
2018-01-12 14:06:04.176019+0800 wepdemo2[1435:503032] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView sd_setImageWithURL:]: unrecognized selector sent to instance 0x103e887a0'
*** First throw call stack:
(0x18236e364 0x1815b4528 0x18237b828 0x18bce521c 0x182373d10 0x182258ecc 0x1011a2458 0x18b924ae8 0x18b9246c0 0x18b92b28c 0x18b9284ec 0x18b9973a0 0x18bb84d10 0x18bb89aa8 0x18be252d4 0x18c0fd12c 0x18be24f38 0x18be25798 0x18c5aa7d0 0x18c5aa674 0x18c3182dc 0x18c4b13dc 0x18c31818c 0x18c0fc78c 0x18bb881ec 0x18bf9dde8 0x184a321f0 0x184a3aaf8 0x10146928c 0x1014759e4 0x184a667f8 0x184a6649c 0x184a66a38 0x18231697c 0x1823168fc 0x182316184 0x182313d5c 0x182233e58 0x1840e0f84 0x18b98867c 0x1011a2768 0x181d5056c)
libc++abi.dylib: terminating with uncaught exception of type NSException
待更。