I am attaching the image of my ui here.
User Inteface:
I want to make the buttons with grievance details and mdm details captions hidden at runtime depending on the condition but I want the button with logout caption to shift upwards automatically. But its not happening. I am attaching the image of my result.
UI after removing the two buttons:
And here is the image of the constraints applied on the button with the caption logout.
Constraints applied on the logout button:
If your app's Deployment Target is above iOS 9 then you should use UIStackView. You can easily achieve with UIStackView.