Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wookay/uidesign
a simple UI DSL for swift
https://github.com/wookay/uidesign
Last synced: 2 days ago
JSON representation
a simple UI DSL for swift
- Host: GitHub
- URL: https://github.com/wookay/uidesign
- Owner: wookay
- Created: 2016-01-25T23:23:33.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-27T17:43:32.000Z (almost 9 years ago)
- Last Synced: 2024-04-29T23:53:24.061Z (7 months ago)
- Language: Swift
- Homepage: https://github.com/wookay/UIDesign
- Size: 51.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
UIDesign
========[![Build Status](https://api.travis-ci.org/wookay/UIDesign.svg?branch=master)](https://travis-ci.org/wookay/UIDesign)
```sh
$ open samples/Counter/Counter.xcworkspace
``````swift
import UIDesignclass ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()design { ui in
ui.add_spacing(60)
let label = ui.add_label("")
var n = 0 {
didSet {
label.text = String(n)
}
}
let up = ui.add_button("up") { n += 1 }
ui.add_button("down") { n -= 1 }
move(label, to: up.rightside)n = 0
}
}
}
```