Im new to Swift
and now making a project that includes showing many photos from the web and I understand that I need to use SDWebImage
.
I saw related questions here and in other places but all are in Objective-C
syntax and not working for me.
What I did till now:
SDWebImage
folder to my folderimport
#import <"SDWebImage/UIImageView+WebCache.h">
import SDWebImage/UIImageView+WebCache.h
etc..
Can someone please help me import it
Firstly, you need configure Bridging Header
, it is described here at SO. Use the following:
#import <SDWebImage/UIImageView+WebCache.h>
This will import Objective-C
code to Swift
code
Secondly, just use it, like:
self.imageView.sd_setImageWithURL(self.imageURL)