Instance Method

setNeedsUpdateConstraints

Controls whether the view’s constraints need updating.

Declaration

- (void)setNeedsUpdateConstraints;

Discussion

When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.

See Also

Triggering Auto Layout

- needsUpdateConstraints

A Boolean value that determines whether the view’s constraints need updating.

- updateConstraints

Updates constraints for the view.

- updateConstraintsIfNeeded

Updates the constraints for the receiving view and its subviews.