Step by Step Guide :-
Step 1 :- Set constraint to UIView

Step 2 :- Set constrain to Label 1

Step 3 :- Set constraint to Label 2

Step 4 :- Most tricky give a bottom to UILabel from UIView .

Step 5 :- (Optional) Set constrain to UIButton

Output :-

Note :- Make sure you have set Number of lines =0 in Label property.

I hope this info enough to understand Autoresize UIView according to UILabel’s height and Autoresize UILabel According to text.