I'm already using AFNetworking for async image download. I was wondering if there's a way for storing on disk or Core Data, should I investigate SDWebImage for that? Or you would suggest to have a custom solution. Basically I would like to have a very transparent way to get images from a url, so first look for them in a NSCache, if not found look on disk (or Core Data)l if not found again download async. Thanks for any idea
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
Give this a try...
https://github.com/rs/SDWebImage
You could have a look to EGOImage which basically makes asynchronous calls and caching of images on the file system.
SDWebImage has proven to be a really solid implementation of async image fetching and caching.
If you're using your web images for buttons or imageviews you can even call the
-(void)setImageWithURL:(NSURL *)url
methods that will check the cache, get the image for you and if it's not there, it will async download it and store it in the cache before setting it.If you need the images for some other stuff, you can still benefit from this library by calling :
and retrieving the image later on the delegate method:
Note that
does check the cache before attempting to download, so it is safe to call this every time you need an image.