Skip to content

Instantly share code, notes, and snippets.

@mmackh
Created June 10, 2022 10:45
Show Gist options
  • Save mmackh/8514b7815503c11874f04aa8ef9684df to your computer and use it in GitHub Desktop.
Save mmackh/8514b7815503c11874f04aa8ef9684df to your computer and use it in GitHub Desktop.
import BaseComponents
class LayoutViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.addSplitView { splitView in
splitView.addSplitView(configurationHandler: { splitView in
splitView.direction = .horizontal
splitView.addSubview(UIView().color(.background, .systemRed), layoutType: .equal)
splitView.addSplitView(configurationHandler: { splitView in
splitView.addSubview(UIView().color(.background, .systemPurple), layoutType: .equal)
splitView.addSubview(UIView().color(.background, .systemMint), layoutType: .equal)
}, layoutType: .equal)
}, layoutType: .equal)
splitView.addSplitView(configurationHandler: { splitView in
splitView.direction = .horizontal
splitView.addSplitView(configurationHandler: { splitView in
splitView.direction = .horizontal
splitView.addSubview(UIView().color(.background, .systemOrange), layoutType: .equal)
splitView.addSubview(UIView().color(.background, .systemPink), layoutType: .equal)
splitView.addSubview(UIView().color(.background, .systemBrown), layoutType: .equal)
}, layoutType: .equal)
splitView.addSplitView(configurationHandler: { splitView in
splitView.addSubview(UIView().color(.background, .systemBlue), layoutType: .equal)
splitView.addSubview(UIView().color(.background, .systemCyan), layoutType: .equal)
splitView.addSubview(UIView().color(.background, .systemGreen), layoutType: .equal)
}, layoutType: .equal)
}, layoutType: .equal)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment