title: UITableViewCell height resize when image is downloaded
body: <p>I'm using <code>UIImageView+AFNetworking</code> category for async image loading. Everything works fine, but I've tried a couple of things and wasn't successful when resizing the cell's height according to the downloaded image. I want the image to fit to the width of the cell but resize in height, but I don't know how to accomplish that. I've tried reloading the row where the image was downloaded but that just causes the <code>cellForRowAtIndexPath</code> to fire again and set everything again, etc. Almost a recursion.</p>
  
  <p>I'm calculating the new image size difference and storing that in <code>NSMutableArray</code> and then reloading the row in the success block in UIImageView's <code>setImageWithURLRequest:placeholderImage:success:</code>.</p>
  
  <p>I get the correct height for a couple of rows in <code>heightForRowAtIndexPath</code> but then, the table starts acting weird and everything is overlaying, etc.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I eventually used Ezeki's answer. I also wrote a post on the topic and made a sample app that uses this technique.</p>
  
  <p>Check it out on <a href="http://candycode.io/dynamic-uitableview-height-for-downloaded-images/" rel="noreferrer">here</a>.</p>