Instance Method

setNeedsUpdateConstraints()

Controls whether the view’s constraints need updating.

Declaration

func 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

Related Symbols

func needsUpdateConstraints()

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