0

I am using UIImageView+AFNetworking and am wondering if there is a way to get the UIImage from the cache? It seems like there should be a method to return the UIImage based on the URL.

Possible?

Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412

2 Answers2

1

AFNetworking already caches images automatically (and doesn't expose the cache publicly). You should just be able to request from a URL and it'll either come from the cache or it will get cached when it's downloaded from the remote website.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • Yeah, but isn't `AFImageCache` private and only implemented in the `UIImageView+AFNetworking.h` file? Looks that way to me... – Nic Hubbard Jan 14 '14 at 19:12
  • Yeah, you're right. I've done a bit more research and I've changed my answer a bit and added a link to a git issue that's pretty close to what you're asking. Why not just rely on AFNetworking to do the right thing? – Michael Dautermann Jan 14 '14 at 19:22
0

There is great AFNetworking alternative called APSmartStorage. It supports downloading, memory and disk cache.

Krivoblotsky
  • 1,492
  • 11
  • 17