title: Bad image quality when setting a UIImageView from URL String
body: <p>I made a group chat app so that when you tap on a person's avatar next to their chat bubble, it takes you to a profile page where you can see their profile picture fullscreen.</p>
  
  <p>In the profile controller, I have </p>
  
  <pre><code>self.profileImageView.loadImageUsingCacheWithUrlString(self.profileAvatar)
  </code></pre>
  
  <p>in viewDidLoad, with <code>self.profileAvatar</code> being a URL String to the user's Facebook profile picture. This is the image loading function I'm using:</p>
  
  <pre><code>let imageCache = NSCache&lt;NSString, UIImage&gt;()
  
  extension UIImageView {
  
  func loadImageUsingCacheWithUrlString(_ urlString: String) {
  
      self.image = nil
  
      // Check cache for image first
      if let cachedImage = imageCache.object(forKey: urlString as NSString) {
          self.image = cachedImage
          return
      }
  
      // Otherwise fire off a new download
      Alamofire.request(urlString)
          .responseImage { response in
  
              if let downloadedImage = response.result.value {
                  // image is here.
                  imageCache.setObject(downloadedImage, forKey: urlString as NSString)
                  self.image = downloadedImage
              }
      }
  }
  }
  </code></pre>
  
  <p>When I tap on an avatar to see the fullscreen image, the quality is awful. I have it set to <code>.scaleAspectFill</code>. Is there anything I can do to improve the image quality? </p>