iOS 样式 Gaikan
- 授权协议: MIT
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/akane/Gaikan
软件介绍
Gaikan 是 Swift 中的一个 DSL 声明 ,提供了强大的样式功能。它是参照 JS 和 CSS 模块中的 CSS 创建出来的。
提供一个 Style 对象来设计 UIView(s) 。
let myLabelStyle: Style = [ .Color: UIColor.redColor(), .Border: Border(width: 1, color: UIColor.greenColor()), .Font: UIFont(name: "Courier", size: 24),
]/// ORlet myLabelStyle = StyleRule() { (inout style: StyleRule) -> () in
style.color = UIColor.redColor()
style.border = Border(width: 1, color: UIColor.greenColor())
style.font = UIFont(name: "Courier", size: 24)
}self.label.applyStyle(myLabelStyle)可查看样品来了解如何将 Gaikan 集成到一个项目中。
