I have no idea how to set constrant.height to constant value:
override func updateConstraints() {
layout(view) { view in
let viewHeight = 67
view.top == view.superview!.top
view.left == view.superview!.left
view.height == viewHeight // Error: Binary operator '==' cannot be applied to operands of type 'Dimension' and 'Int'
view.width == view.superview!.width
}
super.updateConstraints()
}
This should be simple, put as a Swift newbie atm I don't have any working idea, would welcome any help :)
You probably solved this one by yourself, but for anybody else it seems that the ==-operator is not overloaded for Int. So changing the definition of your variable to:
let viewHeight: CGFloat = 67
will do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With