Problem using SDWebImage in Swift

I am trying to use SDWebImage in swift, the identifier of the file to use is called UIImageView + WebCache.h

I added it to my header using

#import "UIImageView+WebCache.h"

Now I am trying to load this file in swift using:

var webCah = UIImageView+WebCache()

and I get an error:

Using an Unresolved WebCache Identifier

I believe that it thinks I'm trying to use uiimageview when I just try to use this objective-c class

How to name this class?

+4
source share
1 answer

UIImageView+WebCache - , UIImageView SDWebImage. , , UIImageView.

:

var imageView :UIImageView = UIImageView() // example, this will probably come from elsewhere in your app
imageView.sd_imageURL
// Or

imageView.sd_cancelCurrentImageLoad

, , , https://github.com/rs/SDWebImage/blob/master/SDWebImage/UIImageView%2BWebCache.h

+4

All Articles