The active state of the constraint.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
Frameworks
- UIKit
- App
Kit
Declaration
var isActive: Bool { get set }
Discussion
You can activate or deactivate a constraint by changing this property. Note that only active constraints affect the calculated layout. If you try to activate a constraint whose items have no common ancestor, an exception is thrown. For newly created constraints, the is
property is false
by default.
Activating or deactivating the constraint calls add
and remove
on the view that is the closest common ancestor of the items managed by this constraint. Use this property instead of calling add
or remove
directly.