Gaika是Swift中的一个DSL声明,提供了强大的样式功能。它是参照JS和CSS模块中的CSS创建出来的。
提供一个Style对象来设计UIView(s)。
let myLabelStyle: Style = [ .Color: UIColor.redColor(), .Border: Border(width: 1, color: UIColor.greeColor()), .Fot: UIFot(ame: "Courier", size: 24), ]/// ORlet myLabelStyle = StyleRule() { (iout style: StyleRule) -> () i style.color = UIColor.redColor() style.border = Border(width: 1, color: UIColor.greeColor()) style.fot = UIFot(ame: "Courier", size: 24)}self.label.applyStyle(myLabelStyle)可查看样品来了解如何将Gaika集成到一个项目中。
评论