robb / Cartography

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

Add offset operator to allow usage of `NSLayoutAnchor.anchorWithOffset(to:)` APIs #352

Open jayrhynas opened 1 year ago

jayrhynas commented 1 year ago

Uses with NSLayoutAnchors and anchorWithOffset(to:) to create a Dimension representing the distance between two Edge Dimension can now hold an NSLayoutDimension anchor (representing an offset dimension) or produce a NSLayoutDimension for width or height, as required.

I used |-| for the custom operator, but we could use a different operator such as ]-[ (to mirror VFL) or some other operator.