So I have a UITableViewCell that I would like to calculate the size of to return in
tableView:heightForRowAtIndexPath:
but this cell has a few UILabels
inside.
I could go and calculate all the heights using sizeWithAttributes
, but this would give me quite some work to do this for all my cells (I have quite a few different cells), so I am looking for a way to have my cells calculate their own height.
I have tried to use systemSizeFittingSize
method, but that fails because it only accounts for one row (apparently).
What can I do? I have been looking for an answer to this question for a long time and none of the answers seem to be working all the time.