Step by Step Guide :-

Step 1 :- Set constraint to UIView

  1. Leading. 2) Top. 3) Trailing. (From mainview)

http://i.stack.imgur.com/M6Ck5.gif

Step 2 :- Set constrain to Label 1

  1. Leading 2) Top 3) Trailing (From it’s superview)

http://i.stack.imgur.com/FeBFW.gif

Step 3 :- Set constraint to Label 2

  1. Leading 2) Top 3) Trailing (From its superview)

http://i.stack.imgur.com/GLCVp.gif

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

http://i.stack.imgur.com/WcjmM.gif

Step 5 :- (Optional) Set constrain to UIButton

  1. Leading 2) Bottom 3) Trailing 4) Fixed Height (From mainview)

http://i.stack.imgur.com/CYwZG.gif

Output :-

http://i.stack.imgur.com/zaM0A.gif

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

http://i.stack.imgur.com/g3w1L.png

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