Skip to content

tomrlq/LRImageLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LRImageLoader

Pod Version

  • LRImageLoader is an image loading and caching library for iOS

Installation

  • Podfile
pod 'LRImageLoader'
  • Manually

add LRImageLoader.framework to "General->Embedded Binaries"

Requirements

  • Minimum iOS 8.0

Loading into UIImageView

  • Objective-C
[[LRImageStore sharedStore] loadImage:imageUrl
                          placeholder:[UIImage imageNamed:@"placeholder"]
                                 into:imageView];
  • Swift
LRImageStore.shared().loadImage(imageUrl,
                                placeholder: #imageLiteral(resourceName: "placeholder"),
                                into: imageView)

Loading as UIImage

  • 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
    }
}