Advertisement
d2burke

UIImageView+Loader.swift

Feb 28th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.33 KB | None | 0 0
  1. import Foundation
  2. import Alamofire
  3. import AlamofireImage
  4.  
  5. extension UIImageView {
  6.     func loadImage(imageURL: String) {
  7.         Alamofire.request(imageURL).responseImage { response in
  8.             if let image = response.result.value {
  9.                 //set image
  10.             } else {
  11.                 //TODO: Add failure block
  12.             }
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement