Instance Method

constraintsAffectingLayout(for:)

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

Declaration

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

Parameters

axis

The axis for which the constraints should be found.

Return Value

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

Discussion

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.