by alin23 · 4y ago · 0 comments
In my extensive experience, this is the only major disadvantage I found: UIs with hundreds of stylized elements can be too slow
I suspect this happens especially because adding style to an element makes the graph deeper (e.g. Text(“”).shadow().colorInvert() means SwiftUI will add three function calls in the stack on each render pass)
But if that case does not apply to your UI, the advantages are massive.
For example my Volum [1] app works on iOS, iPadOS and macOS and because of SwiftUI it shares 95% of the code between platforms. That’s hard enough with other frameworks that I couldn’t even consider starting such a project before SwiftUI.