为 iOS 提供即插即用 WebP 图像支持。与许多其他图像抓取和缓存库兼容,包括 Haneke
use_frameworks!
pod 'YKWebPImage'
就是这样!没有任何代码要写,只需将 webp 数据或文件传递给 UIImage API 即可。
为了全面揭示信息,这个库使用了很多 swizzling 来实现“即插即用”的功能。具体来说,以下方法进行了 swizzling
[UIImage imageNamed:inBundle:compatibleWithTraitCollection:]
[UIImage initWithData:]
[UIImage initWithData:scale:]
[UIImage initWithContentsOfFile:]
尽管如此,我们已经尽最大努力确保实现符合 UIKit 的期望。
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.