I am building a photo album app and find a few image caching libraries, namely:
What one you\'d re
I tried using SDWebImage.
Agreed that it is very easy to integrate.
However the big issue with this library is that it does not honour "max-age" cache control.
The library is still under development but they are not picking this limitation.
Personally, I think SDWebImage is the best because it is an absolute no-effort solution, and provides the simplest mechanism for cache handling as it is simply an extension of the UIImageView class.
There are multiple frameworks that solve this problem. Just to name a few:
Swift:
Objective-C:
Try also APSmartStorage. It automatically caches UIImage/NSData on disk or in memory.
It has cute Blocks–style API;
// setup data parsing block
APSmartStorage.sharedInstance.parsingBlock = ^(NSData *data, NSURL *url)
{
return [UIImage imageWithData:data scale:UIScreen.mainScreen.scale];
};
...
// show some progress/activity
...
// load object with URL
[APSmartStorage.sharedInstance loadObjectWithURL:imageURL callback:(id object, NSError *error)
{
// hide progress/activity
if (error)
{
// show error
}
else
{
// do something with object
}
}];
It's quite smart and still simple:
Moa
Moa is an image download library written in Swift. It allows to download and show an image in an image view by setting its moa.url property.
Installation Use CocoaPods to add Moa to your project. Just add the following line to your Podfile.
pod 'moa', '~> 8.0'
I strongly recommend you to try Kingfisher and SDWebImage. Both works perfectly for downloading and caching images from the web.