Closed vandilsonlima closed 7 years ago
@vandilsonlima the compiler is inferring that w
is an int, to use a variable in a layout expression, the value needs to be a CGFloat
let w: CGFloat = 100
view.widthAnchor == w
Should compile
@ateliercw thanks for your help. I didn't notice that I should use a CGFloat instead of an Int.
why can't I do this?
let w = 100
view.widthAnchor == w
Compile sayswhile this is possible
view.widthAnchor == 100