1) Design your screen like in view 5.
2) Set up the constraints with the "opened" height of the pop up view. The bottom of the view above needs to be connected to the top of the popup view and that top view shouldn't have a fixed height, obviously.
3) Create an outlet for the height constraint
4) In windowDidLoad store the "opened" height by getting it from the constraint (so that you don't have to maintain it separately in the code). For example (where _popUpHeight is a CGFloat member variable):
- (void)viewDidLoad
{
_popUpHeight = _popUpHeightConstraint.constant;
}
5) Animate the constraint when needed. Something like this:
- (IBAction)togglePopup:(id)sender {
[UIView animateWithDuration:5
animations:^{
_addBannerDistanceFromBottomConstraint.constant = (_popupState) ? 0 : _popUpHeight;
}];
_popupState = !_popupState;
}