As @Henit mentioned, you can set IBOutlet for constraints as well.
For example,
@property(weak, nonatomic) IBOutlet NSLayoutConstraint *viewHeight;
so now, you can remove this constraint like this:
[myView removeConstraint: viewHeight];
Or else if you want to remove all / multiple constraints related to your view then,
[myView removeConstraints: constraintsArrayHere]; // custom array of constraints references
[myView removeConstraints: [myView constraints]]; //all constraints
Then later you can add your new constraints in the same manner using addConstraint
or addConstraints
method.
For more details go through Apple Documentation here.
Hope this helps.