Main question : I have three labels (label1, label2, label3) one below the other. How do I align label3 below label1 if, during runtime, label2 is set to hidden or if removed from superview.
Initial View:
Label1
vertical spacing
Label2
vertical spacing
Label3
Action:
set Label2.hidden = yes;
Output:
Label1
vertical spacing
Label3
What I have tried is to apply vertical spacing constraints:
- between label1 and label2 with some priority
- between label2 and label3 with high priority wrt to 3rd constraint
- between label1 and label3 with lowest priority
Now when I remove the label2 how do I refresh the constraints or should I keep track of all constraints and remove the 2nd constraint when label2 is hidden?