Is there a way to install and uninstall an Xcode interface builder constraint
programmatically?
Connect the IBOutlet for the NSLayoutConstraint by CTRL+click the constraint and drag it to the viewController (for ex. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraint;
).
For removing the constraint:
[self.view removeConstraint:constraint]
for installing the constraint:
[self.view addConstraint:constraint]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With