Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include SDWebImage framework

Tags:

sdwebimage

I am working on an iPhone app. In this app I have used many images and I need to store those images in cache memory. For this I have found SDWebImage is the right framework but I can not include this framework in my iPhone project. Can anyone please suggest how to include this framework in my project and how to save and retrieve images using this framework?

like image 654
user1417638 Avatar asked Sep 07 '12 09:09

user1417638


2 Answers

Last compiled framework is 3.6.0 and you can find it in: https://github.com/rs/SDWebImage/releases

For easier access, the direct link to the framework is below: https://github.com/rs/SDWebImage/releases/download/3.6/SDWebImage-3.6.framework.zip

like image 43
DeZigny Avatar answered Oct 09 '22 09:10

DeZigny


Go to SDWebImage frame work download Site.

  1. -Click on Zip tag and download the archive.
  2. -Unarchive the file.
  3. -You will find the "SDWebImage" folder.
  4. -see that path and add this folder in your project. (don't forget to take copy of folder in your project instead of jusk linking).

So far GOOD.

Goto your view controller and add

#import <SDWebImage/UIImageView+WebCache.h>
#import "UIImageView+WebCache.h"

and use imageview method like below.

UIImageView *imageView =  [[UIImageView alloc] init]; 
[imageView setImageWithURL:[NSURL URLWithString:@"ImageURL here"]];
[imageView release];

You can view image even after you close and reopen the application because of caching. Even you can delete cache when you wish by,

clearCache and clearDisk method in Manager

And you can trace each image by tracing NSdictionary in sourcecode(Check if you interested). And best thing is you can easily add progressbar on image view while image is under downloading.

For more Info - SDWebImage Doc

Keep Enjoy Coding. By the way great question(Even useful for beginners) And thanks for rs for great framework.

like image 172
CoreCoder Avatar answered Oct 09 '22 08:10

CoreCoder