- LRImageLoader is an image loading and caching library for iOS
- Podfile
pod 'LRImageLoader'
- Manually
add LRImageLoader.framework to "General->Embedded Binaries"
- Minimum iOS 8.0
- Objective-C
[[LRImageStore sharedStore] loadImage:imageUrl
placeholder:[UIImage imageNamed:@"placeholder"]
into:imageView];
- Swift
LRImageStore.shared().loadImage(imageUrl,
placeholder: #imageLiteral(resourceName: "placeholder"),
into: imageView)
- Objective-C
[[LRImageStore sharedStore] fetchImageForURL:imageUrl progress:nil completion:^(UIImage * _Nullable image, NSError * _Nullable error) {
if (!error) {
// handle image
}
}];
- Swift
LRImageStore.shared().fetchImage(forURL: imageUrl, progress: nil) { (image, error) in
if let successImage = image {
// handle image
}
}