Instance Method

removeConstraint(_:)

Removes the specified constraint from the view.

Declaration

func removeConstraint(_ constraint: NSLayoutConstraint)

Parameters

constraint

The constraint to remove. Removing a constraint not held by the view has no effect.

Discussion

When developing for iOS 8.0 or later, set the constraint’s isActive property to false instead of calling the removeConstraint(_:) method directly. The isActive property automatically adds and removes the constraint from the correct view.