Skip to content

Instantly share code, notes, and snippets.

@aChase55
Created February 18, 2019 23:51
Show Gist options
  • Save aChase55/8f0e9ccceb4a0718e399477276270861 to your computer and use it in GitHub Desktop.
Save aChase55/8f0e9ccceb4a0718e399477276270861 to your computer and use it in GitHub Desktop.
Alamofire image
import Foundation
import Alamofire
import AlamofireImage
extension UIImageView {
func loadImage(_ url:String?) {
guard let url = url else { return }
Alamofire.request(url).responseImage {[weak self] response in
guard let self = self else { return }
if let image = response.result.value {
self.image = image
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment