I have a UITableViewCell
whose height needs atleast 106. I need to set the contentView height to increase if in case the label inside the cell surpasses the height 106.
Here is what i did.
What else do i need to do so that the cell gets it's height?
If I am getting it right, your table view cell contains a label. You want the minimum height of the cell to be 106, and if the text content in your label increases such that the label doesn't fit anymore within the cell height, the height of the cell should increase. If this is the problem, then you need to use automatic dimension and for that you have to do two things
1) For automatic dimension to work you have to set layout constraints in such a way that there is at least one constraint connecting a cell subview and the top of contentView and at least one connecting a cell subview and the bottom of the contentView. Assuming there is just a label inside the cell, give leading, trailing, top and bottom constraints. You may give a 10px padding on all sides.
2) Set estimatedRowHeight for the table view as 106. 3) In heightForRowAtindexPath delegate method, return UITableViewAutomaticDimension
You are all set now.