Swift:Use AFNetworking setImageWithURL

From Hawk Wiki
Jump to: navigation, search

Create the bridging file: create a new Objective-C file, name it anything, and when you save it, Xcode will prompt you generate a bridging file.
In an Objective-C bridging file:

#import <AFNetworking/UIImageView+AFNetworking.h>

In the swift view file, to set a imageView using URL:

setImageWithURL(NSURL(string: thumbnailURL))