How to include SDWebImage framework

旧城冷巷雨未停 提交于 2019-11-27 16:43:38

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/12315539/how-to-include-sdwebimage-framework

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!