4 ms·
Author here! Aside from Lunar (https://lunar.fyi/ https://lunar.fyi/) all my apps over at https://lowtechguys.com/ https://lowtechguys.com/ are 100% SwiftUI. I
by alin23 4y ago
Author here! Aside from Lunar (https://lunar.fyi/ https://lunar.fyi/) all my apps over at https://lowtechguys.com/ https://lowtechguys.com/ are 100% SwiftUI.
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.
[1] https://lowtechguys.com/volum https://lowtechguys.com/volum
- soapdog 4y agoYour apps look really neat. :D
- alin23 4y agoThanks! ^_^
- xiaolingxiao 4y agohey i also build mobile apps in swiftui. do you have more resources on why $binding could be slow?
- alin23 4y agoWell, it's not @Binding that's slow, it's the fact that it's not immutable like @State, so on each `body` call, the binding's `get()` function has to be called again.