Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
247 views
in Technique[技术] by (71.8m points)

iphone - iOS - Caching and loading images asynchronously

I want an image loading and caching library for iOS that

  • loads images asynchronously,
  • caches images, with a configurable cache size and LRU behaviour,
  • checks to see if images have been updated, using HTTP HEAD,
  • doesn't cache anything in the event of an error code or an invalid image.

I've looked at HJCache, but it only satisfies the first two of these criteria. Is there something better?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I know that this thread has been answered, but I have tried a library that has worked great. I was using ASIHttpRequest before and the difference is big.

https://github.com/rs/SDWebImage

Also, if someone needs to Resize or Crop the remote images, and have the same features that SDWebImage provide, I have integrated SDWebImage library with UIImage+Resize library (by Trevor Harmon), and created an example project. I modified the code of SDWebImage to deal with transformations (crop, resize).

The project is public on https://github.com/toptierlabs/ImageCacheResize. Feel free to use it!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...