I apologize my original question wasn't clear.
I mean if I created a constraint in code, such as:
NSLayoutConstraint(item: labelName, attribute: .leading, relatedBy: .equal, toItem: container, attribute: .trailing, multiplier: 1.0, constant: 0.0).isActive = true
Can I later change it with another code like:
NSLayoutConstraint(item: labelName, attribute: .leading, relatedBy: .equal, toItem: container, attribute: .trailing, multiplier: 1.0, constant: 5.0).isActive = true
Where I repeat the previous statement above with a different value for the parameter constant:. Would that add another constraint, or would it replace the one I already set in the first statement.
I tried using a variable to hold a reference to the constraint such as so:
let layoutConstraint = NSLayoutConstraint(item: labelName, attribute: .leading, relatedBy: .equal, toItem: container, attribute: .trailing, multiplier: 1.0, constant: 0.0).isActive = true
Then I changed the value of the constant to 5.0 like this:
layoutConstraint.constant = 5.0
I don't know what to do after that. Is there a statement I need to execute after that to update the constraint to the new value(s)?