I\'m really very weak in constraints part of ios. I have gone through many reference link as shown below but still not able solve my issue.
Hide autolayout UIView : How
just make the outlet of height of both UIView and use constant property to change the height constraints like...
if conditionfails{ heightconstOfView1.constant = 0 } else{ heightconstOfView2.constant = 0 }