title: UIImageView caching data from API
body: <p>When I scroll my UITableView quickly, imageView shows the wrong images from API. (i.e. Samsung image shown in Brexit article and so on).</p>
  
  <p>Here`s an extension allowing me to download images(maybe I can change something here):</p>
  
  <pre><code>extension UIImageView {
      func donwloadImage(from url: String) {
          let urlRequest = URLRequest(url: URL(string: url)!)
          let task = URLSession.shared.dataTask(with: urlRequest) { (data,response,error) in
  
              if error != nil {
                  print(error)
                  return
              }
  
              DispatchQueue.main.async {
                  self.image = UIImage(data: data!)
  
              }
          }
          task.resume() 
      }
  
  }
  </code></pre>