| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
🐳 XLayout is a Swift Auto Layout DSL with more lightweight syntax for macOS.
hahaha, like me. :)
Integrate XLayout into your project manually.
Let's make some constraints like this:

щ(`ω´щ)
(╯-_-)╯~╩╩
m9(`Д´)
ヽ(`⌒´)ノ
view1.xLayout.leading(20).bottom(-15).width(150).height(100)
view2.xLayout.leading(view1.trailing + 80).height(30).trailing(-15).top(40) view1.width == 150
view1.height == 100
view1.leading == 20
view1.bottom == -15
view2.leading == view1.trailing + 80
view2.height == 30
view2.trailing == -15
view2.top == 40 // the | means superView and the - means space
view1.width == 150
view1.height == 100
view1.visualLayout(.H(|-20-view1), .V(view1-15-|))
view2.height == 30
view2.visualLayout(.H(view1-80-view2-15-|), .V(|-40-view2)) view.xLayout.leading(==(contentView.leading*0.7 + 20) ~ 210)
.trailing(<=(*0.6-50))
.bottom(>=(contentView.bottom - 20))
.top(contentView.top*0.8)
.width(200)
view.leading == (contentView.leading*0.7 + 20) ~ 210
view.trailing <= *0.6-50
view.bottom >= contentView.bottom - 20
view.top == contentView.top*0.8
view.width == 200
view.visualLayout(.H(|-10-viewT-(*0.9 + 20)-|), .V(|-viewT-view))XLayout is released under the MIT license. See LICENSE for details.
| Back | FazBrowse Home | New Git URL |