Rightpoint / Anchorage

A collection of operators and utilities that simplify iOS layout code.
MIT License
627 stars 46 forks source link

Relative alignment samples outdated #53

Closed daneov closed 6 years ago

daneov commented 6 years ago

Hello,

I was trying to do the following:

view.centerXAnchor == 2 * containe.trailingAnchor / 3

but I receive the compiler error:

Binary operator '*' cannot be applied to operands of type 'Int' and 'NSLayoutXAxisAnchor'

Swift Version: 3.2

How can I achieve this relative positioning?

ZevEisenberg commented 6 years ago

@daneov thanks for taking the time to write in! I'm not able to reproduce this error with Anchorage 4.2.1 in Swift 3.2 or 4.0. This feature was added relatively recently, so please make sure you're running Anchorage 4.2 or later.

daneov commented 6 years ago

Seems to be solved by doing so, or the combination from switching to Swift 4.0 and updating my pods :)

Thanks for responding this quickly though!