Splits Edge type into EdgeXAxis and EdgeYAxis types
Provides compile-time safety to ensure that invalid constraints are not created between edges on different axes.
Before this change, the following code would compile but raise an exception at runtime:
constrain(view1, view2) { view1, view2 in
view1.top == view2.left
}
Uncaught Exception at File.swift:2: Constraint improperly relates anchors of incompatible types: <NSLayoutConstraint:0x600002e9ccd0 UIView:0x133d0f610.top == UIView:0x133d0f090.left (active)> (NSInvalidLayoutConstraintException)
Now, this will raise a compile time error:
Binary operator '==' cannot be applied to operands of type 'EdgeYAxis' and 'EdgeXAxis'
Splits Edge type into EdgeXAxis and EdgeYAxis types Provides compile-time safety to ensure that invalid constraints are not created between edges on different axes.
Before this change, the following code would compile but raise an exception at runtime:
Now, this will raise a compile time error: