ImageLoader
ImageLoader 是一个使用 Swift 编写的异步图像加载工具。它是 iOS 上的轻量级和快速图像加载器。
功能
- 具有 ImageView 类别简单方法的。
- 通过 URL 控制加载器以继续、暂停和取消。
- 可以自行设置缓存模块,默认缓存(磁盘)使用磁盘空间和不使用内存。
- 图像加载由 ImageLoader 处理,而不是 UIImageView。
- 在图像视图开始加载另一幅图像后,之前的加载任务可以通过缓存来维持。
- 通过
URLLiteralConvertible
支持由NSURL
,String
和NSURLComponents
。 - 当设置图像时优化内存使用。
- 支持 image 类型的 .jpeg,.png
- 全面的单元测试覆盖率
要求
- iOS 8.0+
- Xcode 7.0+ Swift 2.0
ImageLoader | Xcode | Swift |
---|---|---|
0.13.+ | 9.0+ | 4.0 |
0.12.+ | 8.1+ | 3.0 |
0.11.+ | 8.0+ | 3.0 |
0.10.0 | 8.0+ | 2.3 |
0.9.x | 7.3.1 | 2.2 |
如果您的项目目标需要支持 iOS5.x 或 6.x,请使用 ImageLoader。这是一款轻量级、快速且用 Objective-C 编写的 iOS 图像加载器。
安装
CocoaPods
pod 'ImageLoader'
Carthage
要使用Carthage将ImageLoader集成到您的Xcode项目中,请在您的Cartfile
中指定它
github "hirohisa/ImageLoaderSwift" ~> 0.6.0
用法
ImageLoader
load
ImageLoader.request(with: url, onCompletion: { _ in })
UIImageView
imageView.load.request(with: url)
或
imageView.load.request(with: url, onCompletion: { _ in })
许可
ImageLoader遵循MIT许可证。