iosobjective-cuitableviewuilabelsizetofit

Label Size to Fit inside UITableView


The sizeToFit method of UILabel doesn't apply in cellForRowAtIndexPath.

The problem is I need some of my cells to look like this: enter image description here

and others to look like this: enter image description here

What's the solution for this?

Thanks


Solution

  • The sizeToFit method does what it is supposed to do in the cellForRowAtIndexPath method after disabling auto layout in the storyboard.