Currently we have
public enum HorizontalAnchor {
case leading, trailing, left, right, centerX
}
which groups all the horizontal anchors together. This isn't quite correct since you can only combine leading, trailing, centerX together and left, right, centerX together. If you attempt to constrain leading to left you get a runtime error.
We should ensure the correct types are being used together using the method signatures to enforce it, if possible, so the compiler can provide this warning earlier or prevent the erroneous call outright.
Currently we have
which groups all the horizontal anchors together. This isn't quite correct since you can only combine
leading, trailing, centerXtogether andleft, right, centerXtogether. If you attempt to constrainleadingtoleftyou get a runtime error.We should ensure the correct types are being used together using the method signatures to enforce it, if possible, so the compiler can provide this warning earlier or prevent the erroneous call outright.