Skip to content

Instantly share code, notes, and snippets.

@muukii
Created July 10, 2021 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muukii/63379e9a8d2bc5bed865706c448fbe9c to your computer and use it in GitHub Desktop.
Save muukii/63379e9a8d2bc5bed865706c448fbe9c to your computer and use it in GitHub Desktop.
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