How to install SDWebImage

前端 未结 4 421
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 21:40

I need to manage photos in my app and have read much about SDWebImage framework which seems to be the best way to go. However I am finding it incredibly difficult to instal

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 21:53

    When you add the SDWebImage folder in your project then select following option. To add copy of your folder to the destination project and Create groups.

    and then you have to write just like

    #import "UIImageView+WebCache.h"
    

    And make sure that you are adding to all the targets that you want to use that library.

    Documentation at Github :

    Add the SDWebImage project to your project

    • Download and unzip the last version of the framework from the download page
    • Right-click on the project navigator and select "Add Files to "Your Project":
    • In the dialog, select SDWebImage.framework:
    • Check the "Copy items into destination group's folder (if needed)" checkbox

    Or you can use cocoa pods as other answer suggested.

    EDIT : EXAMPLE :

    [self.imageView sd_setImageWithURL:[NSURL URLWithString:"yoururl.png"] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
    

提交回复
热议问题