I wrote a library for working with Auto Layout in Swift. It lets you tweak Auto Layout constraints and watch your app update immediately without a rebuild + run cycle. It’s called Zhi.
The library allows you to specify your auto layout constraints in separate
.styles files. It supports:
- Live reloading of Auto Layout constraints as you save the
.stylesfiles, without a rebuild + run cycle
- Apple's Visual Format Language:
- Support an equations-based syntax:
v1.width = v2.width + 10
In addition, the
.styles files also support:
- Metrics can be specified
- Colors —
rgba()or named colors in
- Image filenames
- Button title and label text
- Font name, size
- Dynamic type style names, e.g.
- and more
This means that you can tweak these properties without rebuilding your app during development.
Try it out and let me know what you think.
I created a Patreon page. I have been writing iOS Dev Nuggets for more than 5 years. If you want to support me, visit Patreon and consider pledging.
As usual, any tips or comments are welcomed via email.