FluidGroup / MondrianLayout

🏗 A way to build AutoLayout rapidly than using InterfaceBuilder(XIB, Storyboard) in iOS.

Home Page:https://medium.com/geekculture/describing-autolayout-with-imaginable-how-it-lays-out-programmatically-mondrianlayout-71efe82f3149

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Support size equalities in views / layoutGuides

JohnEstropia opened this issue · comments

Sample syntax:

button2.mondrian.buildSelfSizing {
    $0.width(.like(button1), .exact(0)).height(.like(button1), .exact(0))
}
button1.mondrian.buildSelfSizing {
    $0.minWidth(60).minHeight(44)
}

you're talking about Classic layout API?
it's could be better to start describing with view.mondrian.layout.
then, view.mondrian.layout has horizontal, edge. so how do you think about adding like in addition.

(currently available)

box1.mondrian.layout.horizontal(.toSuperview).activate()

(example syntax to achieve that you're requesting feature)

button2.mondrian.layout.like(.to(button1)).activate()

I'm not pretty sure like is good naming against .to() or .toSuperview

button2.mondrian.layout.like(.to(button1)).activate()

What if we only need either width or height to be match, but not both?

what if you need width to be match. it's gonna be following.

button1.mondrian.layout.width(.to(button2).width).activate()

did I answer?

that's been available from this PR

#45

Sorry, I didn't know that UILayoutGuides are already supported there. Thanks, closing this ticket now