Hacker News new | ask | show | jobs
by iamcalledrob 1242 days ago
I think Apple really screwed up th dedign of SwiftUI. We're currently refactoring our apps back to AppKit/UIKit. The first 90% is easy, the final 10% is often impossible. You shouldn't have to do what the article author did and change your UI designs due to bugs in the UI framework.

For anyone that's enjoying the idea of SwiftUI (but not the reality), Jetpack Compose on Android might be up your alley.

It doesn't try and wrap legacy views-the framework renders every pixel itself.

This allows you to get the rapid build speed of declarative UI but also an extremely high level of polish.

As a bonus, the core components are open source, so you can see how a Button or CircularProgressIndicator works (for example)

Compose uses normal functions that render themselves and return nothing (rather than returning a crazy complex typed view like SwiftUI does-often breaking the compiler). And "remember {}" blocks for state feels so much simpler than every view being a struct with @State.

In a funny way this functions-not-objects approach is the most surprising design choice made by Compose considering the Java/Kotlin ecosystem it exists within.

1 comments

You’re right, you shouldn’t have to but it seems to be a penalty you currently have to pay if you go all-in with SwiftUI at this stage in its lifecycle. Admittedly, it’s still relatively/technically immature compared to its predecessor, and so you expect certain limitations in comparison. But four versions in, some of these things I’m surprised continue to be points of frustration. I imagine if Apple themselves were stress testing/dog fooding it exclusively then these are things that would have been ironed out by now. The irony, right?

And you’re right, SwiftUI “onboarding” is almost deceitfully simple/natural. And, in general, there being no friction in its UX makes it so easy to gradually build up issues in complete ignorance. And when it does become apparent, you’re working with a gorilla, i.e. steps to rectify are expensive.

I look forward to trying out Compose for all the reasons stated. Thanks for sharing !

The one other thing I’d add as being a major source of frustration and anxiety is SwiftUI’s update cycle. It’s acceptable for there to be issues in any technology, whatever its age, but it’s not satisfactory to need to wait 12 months for the possibility — not even certainty — of a fix. This is what attracts me most about Compose: the transparency and speed of innovation.