Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let backgroundView = UIView.mock(backgroundColor: .neon(.violet))
let box1 = UIView.mock(backgroundColor: .neon(.red), preferredSize: .largeSquare)
let box2 = UIView.mock(backgroundColor: .neon(.yellow), preferredSize: .largeSquare)
view.addSubview(backgroundView)
view.addSubview(box1)
view.addSubview(box2)
mondrianBatchLayout {
backgroundView.mondrian.layout.edges(.toSuperview)
box1.mondrian.layout
.top(.toSuperview, 10)
.left(.toSuperview, 10)
.bottom(.toSuperview, -10)
box2.mondrian.layout
.top(.toSuperview, 10)
.left(.to(box1).right, 10)
.right(.toSuperview, -10)
.bottom(.toSuperview, -10)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment