YAS
YAS is YAML-based stylesheet engine written in Swift.
Installing the framework
Drag YAS.framework
in your project and add it as an embedded binary.
If you use xcodegen add the framework to your project.yml like so:
Getting Started
Let's create a very basic YAML stylesheet and save it in a file named style.yaml
.
Load it up and use it in your Swift code:
Apply a style to a UIView
:
Primitives
References and anchors
By using YAML anchors and references you can reuse values across your stylesheet:
You can also copy the whole style using the YAML extension construct: