Dynamic cell size depending on the size of Image fetched from URL in iOS
<p><strong>INFO:</strong></p>

<p>I have <code>Tableview</code> which is having cells with <code>Imageview</code>.
In that Imageview, I am fetching Different images from imgURL...</p>

<p><strong>What I need:</strong></p>

<p>I need Dynamic height of cell according to the image height fetched from imgURL. </p>

<blockquote>
  <p>NOTE: I am not using auto layout, but i am using auto resizing. </p>
</blockquote>

<p><strong>What i did till now:</strong></p>

<p>I have used asynchronous Image loading in ImageView. ( by <code>#import "UIImageView+WebCache.h"</code>)</p>

<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    HomePostCell *cell=[tableView dequeueReusableCellWithIdentifier:strIdentifier];
    if (cell==nil) {
        cell = [[HomePostCell alloc]
                initWithStyle:UITableViewCellStyleDefault
                reuseIdentifier:strIdentifier];
    }

    [cell.imgMain sd_setImageWithURL:[NSURL URLWithString:strImgURL] placeholderImage:[UIImage imageNamed:@"postPlaceholder"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        if (!error) {

    }];


    return cell;
}
</code></pre>

<p><a href="https://i.stack.imgur.com/J16DB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J16DB.png" alt="right now screen of tableview"></a></p>

<p>Is there any solution for this? or can we use auto layout only for cell resizing?</p>

<p>Thanks in advance..</p>