-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priority documentation not matching reality #55
Comments
@indieSoftware good catch. This appears to be a documentation bug, although it would be interesting to see if we could support the usage as it is spelled in the docs. However, I think it is probably more idiomatic to use the |
Looks like there's a priority issue with the view.topAnchor == container.topAnchor ~ 1 |
I don't think it's a priority issue. The priorities on @discardableResult public func ~ <T, U>(lhs: LayoutExpression<T, U>, rhs: Priority) -> LayoutExpression<T, U> {
var expr = lhs
expr.priority = rhs
return expr
} So the |
The following doesn't work either (is not mentioned by the documentation, but would be nice to have): button.widthAnchor >= 44 ~ 990 I have to use it this way: button.widthAnchor >= 44 ~ Priority(990) or button.widthAnchor >= 44 ~ .required - 10 @ZevEisenberg is right, for some reason the @discardableResult public func ~ (lhs: Int, rhs: Int) -> LayoutExpression<NSLayoutDimension, CGFloat> {
return LayoutExpression(constant: CGFloat(lhs), priority: Priority(rhs))
} |
According to the readme the priority can be set with a number like
but that doesn't seem to work. The compiler always complains about it with the message
Cannot convert value of type 'Int' to expected argument type 'Priority'
.However, using an instance of
Priority
works:So either the documentation is wrong or there is a bug which doesn't allow to use an Integer directly.
The text was updated successfully, but these errors were encountered: