I\'m using Autolayout for my new UITableViewCells in a large project.
I\'ve one TableView where the height of each row is calculated automatically, there I don\'t us
Calculate the height of the content dynamically using boundingRectWithSize.
If you have a UILabel which is dynamic, you can use the following :
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
/* Check Content Size and Set Height */
CGRect answerFrame = [YOUR_LABEL.text boundingRectWithSize:CGSizeMake(240.f, CGFLOAT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont fontWithName:@"" size:14.0f]} context:nil];
CGSize requiredSize = answerFrame.size;
return requiredSize.height;
}