title: How to update tableview cell height after image downloaded and height constraint changed swift?
body: <p>How to update tableview cell height after updating image height constraint of image downloaded async?</p>
  
  <p>How to trigger tableView cell relayout after image downloaded and constraints changed?</p>
  
  <p>What's the best method to do this?</p>
  
  <p>Already tried putting the code inside Dispatch main queue, but same bad results. I'm doing this in cellForRow method, also moved it to willDisplayCell. Again and again this problem...</p>
  
  <p>Example of code using Kingfisher library for image caching:</p>
  
  <pre><code>    if let imgLink = post.imageLink {
                  if let url = URL(string: imgLink) {
  
                      cell.postImage.kf.setImage(with: url, placeholder: UIImage(), options: nil, progressBlock: nil) { (image, error, cacheType, imageURL) in
  
                          if let image = image, cell.tag == indexPath.row {
                              cell.heightConstraint.constant = image.size.height * cell.frame.size.width / image.size.width   
                          }
                      }
                  }
      }
  </code></pre>