title: Remote image size in swift
body: <p>I try to display a multiple image (with different size) inside a tableview cell.. The problem is, the UIImageView (<code>postImage</code>) is in a default size while the image is still downloading. What I want is the UIImageView (<code>postImage</code>) to show the exact height &amp; width for the downloading image (like a place holder for the downloading image).</p>
  
  <pre><code>let postImageURL = posts.photoStdUrl
  
      cell.request?.cancel()
  
      if let image = self.postImageCache.objectForKey(postImageURL) as? UIImage {
          cell.postPhoto.image = image
      } else {
  
          cell.postPhoto.image = nil
  
          cell.request = Alamofire.request(.GET, postImageURL).validate(contentType: ["image/*"]).responseImage() {
              (request, _, image, error) in
              if error == nil &amp;&amp; image != nil {
  
                  self.postImageCache.setObject(image!, forKey: request.URLString)
  
                  tableView.reloadRowsAtIndexPaths([indexPath],  withRowAnimation: UITableViewRowAnimation.Fade)
  
                  cell.postPhoto.image = image
              }
          }
      }
  </code></pre>