FLAnimatedImage 插件为 Nuke 允许您以平滑的滚动性能和低内存占用显示动画 GIF。您可以在项目中的示例中看到。
使用
要启用 GIF 支持,您只需将 isAnimatedImageDataEnabled
设置为 true
。完成之后,您就可以开始使用 FLAnimatedImageView
。
ImagePipeline.Configuration.isAnimatedImageDataEnabled = true
let view = FLAnimatedImageView()
Nuke.loadImage(with: URL(string: "http://.../cat.gif")!, into: view)
安装
手动安装
整个插件是一个包含 23 行代码的单个文件,您可以直接将其复制到项目中,无需处理额外的框架依赖。
CocoaPods
安装插件,请在 Podfile 中添加依赖
# source 'https://github.com/CocoaPods/Specs.git'
# use_frameworks!
pod "Nuke-FLAnimatedImage-Plugin"
Carthage
安装插件,请在 Cartfile 中添加依赖
github "kean/Nuke-FLAnimatedImage-Plugin"
最低要求
Nuke FLAnimatedImage 插件 | Swift | Xcode | 平台 |
---|---|---|---|
Nuke FLAnimatedImage 插件 7.0 | Swift 5.1 | Xcode 11.0 | iOS 11.0 |
Nuke FLAnimatedImage 插件 6.2 | Swift 5.0 | Xcode 10.2 | iOS 10.0 |
Nuke FLAnimatedImage 插件 6.1 | Swift 4.2 – 5.0 | Xcode 10.1 – 10.2 | iOS 10.0 |
Nuke FLAnimatedImage 插件 6.0 | Swift 4.0 – 4.2 | Xcode 9.2 – 10.1 | iOS 9.0 |
依赖项
许可证
Nuke 采用 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。