robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.35k stars 525 forks source link

UILayoutPriority is no longer a number, it is a RawRepresentable #270

Closed philippelatulippe closed 6 years ago

philippelatulippe commented 6 years ago

After updating to Swift 4, the priority operator ~ no longer works with doubles and integers, since UILayoutPriority is a RawRepresentable now. This breaks many constraints defined using Cartography, and requires writing this unwieldy kind of constraint view.bottom == sv.bottom ~ LayoutPriority(rawValue: 900.0).

It would be great if func ~ accepted integers and doubles in order to work around this.

philippelatulippe commented 6 years ago

I've submitted a PR that adds this: https://github.com/robb/Cartography/pull/271

NachoSoto commented 6 years ago

This can be closed now? :)

orta commented 6 years ago

Yep 👍