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 install. I dont know Ruby and have never used a podfile, so am installing it by downloading the latest SDWebImagefolder & framework and adding them to my project. However when I try to import into my viewcontroller using the suggested imports:
#import <SDWebImage/UIImageView+WebCache.h>
#import "UIImageView+WebCache.h"
I get a file not found with on the #import then if I change this to "SDWebImage/UIImageView+WebCache.h" as suggested I get a file not found on the: #import UIImageView+WebCache.h even though I can clearly see it when I open the SDWebImage folder in my project! I'm guessing that these errors also lead to a not found error when I try to use the sd_setImageWithUrl method.
Here's a screen shot of my project:
I hope I can get some help with this as the framework looks to have very good functionality. Any help very much appreciated. Thanks
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
And make sure that you are adding to all the targets that you want to use that library.
Documentation at Github :
Or you can use
cocoa pods
as other answer suggested.EDIT : EXAMPLE :
You can use CocoaPods to manage libraries in your project.
To add SDWebImage to your project you should add this line to your pod file:
UPD
To use CocoaPods, you should install it, to create it you can open Terminal and copy/paste this line:
On next step you should create Podfile in directory that contain your project file. Pods it is text file (you can create it by using xCode or other text editor (only do not use Writer, it uses not correct character for " ' ")).
After you've created Podfile, you should run in Terminal next line:
It command'll create a workspace file, this file you'll use to open your project. All instructions present on the home page of CocoaPods.
I ran into this issue recently, and a less intrusive way to fix this problem is to add an entry to your Header Search Paths (all 3 instances) with the content ./SDWebImage/ (assuming that's where the framework is) so that it considers that folder when looking for includes.
Cocoa Pod
file forSDWebImage
Library.init
the pod file.install
Pod file.update
that pod file.And then you can import the following file.