Instance Method


Returns the constraints impacting the layout of the view for a given axis.


func constraintsAffectingLayout(for axis: UILayoutConstraintAxis) -> [NSLayoutConstraint]



The axis for which the constraints should be found.

Return Value

The constraints impacting the layout of the view for the specified axis.


The returned set of constraints may not all include the view explicitly. Constraints that impact the location of the view implicitly may also be included. While this provides a good starting point for debugging, there is no guarantee that the returned set of constraints will include all of the constraints that have an impact on the view’s layout in the given orientation.

This method should only be used for debugging constraint-based layout. No application should ship with calls to this method as part of its operation.