How to include SDWebImage framework

后端 未结 2 506
谎友^
谎友^ 2020-12-16 05:11

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

相关标签:
2条回答
  • 2020-12-16 05:58

    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

    0 讨论(0)
  • 2020-12-16 06:03

    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.

    0 讨论(0)
提交回复
热议问题