May 22, 2014

Simple Web Image Cache Library For iOS

If you are looking for web images caching solution for your iOS application project, we strongly recommend SDWebImage. It is simple, easy to use, stable and well documented. And impressive list of users speaks for itself.

SDWebImage provides both memory and disk cache with automatic cache expiration and clean up. Although, it might be tempting to roll out custom solution, reiventing the wheel just doesn't worth it in this case. Library addresses quite a lot of small but important issues, which you probably will never really resolve, while creating some quick solution on your own.

Just install it by downloading sources from github or CocoaPODs if you prefer, and forget about headaches with downloading images from web once and forever. Need to download image to UIImageView? Simple:

[imageView setImageWithURL:[NSURL URLWithString:@"http://example.com/image.png"]];

Need to show some image as a placeholder for the case if image was not loaded or while loading is in process? Here:

[imageView setImageWithURL:[NSURL URLWithString:@"http://example.com/image.png"] placeholderImage:placeholder];

Same for UIButton:

[button setImageWithURL:[NSURL URLWithString:@"http://example.com/image.png"] forState:UIControlStateNormal];

If you need to download image manually and then manipulate it somehow, use this code:

SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadWithURL:imageURL
     options:0
     progress:^(NSInteger receivedSize, NSInteger expectedSize)
     {
         // progression tracking code
     }
     completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished)
     {
         if (image)
         {
             // do something with image
         }
     }];

Additionally SDWebImage allows you to use its downloading and caching components independently from the rest of the library if you need to.

We have used the library in few of our projects and quite happy with it.

We would love to hear from you.

This form sends a email right into our inbox. One of us will get back to you as soon as possible.

Thanks for contacting us!

We will respond as soon as possible - normally, within a day.

Want to get in touch even faster? Then, please, try:

Calling us at +1-424-777-2422.

Skyping factorial.complexity.

Something went wrong :(

We are very sorry. Here are some alternative ways to contact us:

Want to get in touch even faster? Then, please, try:

Phone +1-424-777-2422

Skype factorial.complexity

Email info@f17y.com