CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Nov 2017 |
Maintained by Chuong Huynh.
Depends on: | |
HMCThreadSafeMutableCollection | ~> 0.1.0 |
HMCDownloadManager | ~> 0.1.0 |
HMCThreadSafeMutableCollection provides thread safe array and dictionary
HMCDownloadManager provides APIs for downloading image from URL
HMCImageCache is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'HMCImageCache'
To get image caching instance:
HMCImageCache *imageCache = [HMCImageCache sharedInstance];
UIImage *image = ...;
NSString *identifier = ...;
[imageCache storeImage:image withKey:identifier];
image = [imageCache imageFromKey:identifier storeToMem:YES]; // storeToMem: do you want image store to memory
CGSize size = CGSizeMake(300,400); // Image with size 300px x 400 px
image = [imageCache imageFromKey:identifier withSize:size];
[imageCache imageFromURL:url
withTargetSize:CGSizeMake(300,400)
completion:^(UIImage *image){
// do something with image
}
callbackQueue:dispatch_get_main_queue()];
NSURL *url;
UIImageView *imageView;
[imageView HMCSetImageFromURL:url forState: UIControlStateNormal];
NSURL *url;
UIButton *button;
[button HMCSetImageFromURL:url forState: UIControlStateNormal];
[imageCache removeImageForKey:identifier];
[imageCache removeAllCache];
chuonghuynh, minhchuong.itus@gmail.com
HMCImageCache is available under the MIT license. See the LICENSE file for more info.