2 ms·
I've been fascinated by constraints ever since I did some work on iOS, using UIKit. The layout constraint mechanism was super cool. I've been trying to build a
by danielvaughn 4y ago
I've been fascinated by constraints ever since I did some work on iOS, using UIKit. The layout constraint mechanism was super cool.
I've been trying to build a programming language for UI designers, and one of the goals is to let designers describe layouts using constraint-based code that reads as close to natural language as possible.
Something like:
// "the blue box is directly beneath the red box"
BlueBox {
top: @RedBox.bottom
}
// "the red box is 10 pixels to the right of the blue box
RedBox {
left: @BlueBox.right + 10
}
- andsoitis 4y agoYou may be interested in Cassowary https://constraints.cs.washington.edu/cassowary/ https://constraints.cs.washington.edu/cassowary/
- danielvaughn 4y agoYep, looked into Cassowary after digging into AutoLayout (which is apparently based loosely on Cassowary). I struggle with the math since I'm not formally trained.