Created
July 10, 2021 07:11
-
-
Save muukii/63379e9a8d2bc5bed865706c448fbe9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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