I have the following hierarchy in a UITableViewCell.
UITableViewCell
-UIView1
--UILabel1
-UIView2
--UILabel2
I want UIView1 to be hidden in height when UILabel1 has no text. For this, I took a height limit of 0 for UIView1 with the initially deleted state.
Now in cellForRowAtIndexPath I activate this restriction when I check that the row for Label1 is empty or not?
This does not work for the first load of the cell, and when I look at the table, this restriction applies. I use [cell layoutIfNeeded] after activating the restrictions, but it does not seem to work here for the first load.
How can I crack this problem?
source
share