If this is the only restriction you need to change, you can create an IBOutlet for this restriction in your view or view controller, and then just change the restriction based on when you need to change it:
if(shouldHide){ self.nibTitleBarConstraint.constant = 0.f; } else{ self.nibTitleBarConstraint.constant = 44.f; }
If you want to animate this change, just insert -layoutIfNeeded in the animation context:
[UIView animateWithDuration:0.33f animations:^{ [view layoutIfNeeded]
This applies to any constraint constant that you would like to change (height, top space, etc.), as long as your other constraints do not know how to react with changing constraints of this kind.
source share