How to remove constraints programmatically that is added from storyboard?

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)