Hacker News new | ask | show | jobs
by jamil7 2093 days ago
I’ve been pretty on board with SwiftUI and have adopted it liberally in 2 apps but I’m a little disappointed with the state of it right now. Apple is seemingly dusting their hands after this years WWDC leaving us with something thats still half baked and filled with bugs, some that haven’t been fixed since the first announcement.
2 comments

Your comment is refreshing.

I made the mistake of choosing iOS and SwiftUI for the first platform of a niche app, a few months ago. Trying to do things in the way Apple wants seems a good strategy in general, but the experience was bad in countless ways. The developing&publishing approval barrels don't help. I succeeded, but only by throwing vastly more experience and energy at it than should've been necessary.

One of the engineering culture surprises was realizing that a lot of iOS developer chatter seemed to be repeating PR talking points, rather than the frank critiques that I'd expect in analogous situations in many other software development communities.

Besides a theory of fandom or Stockholm Syndrome, or dreaming of a job at Apple, or fearing being deplatformed... maybe there's an incentive for someone with hard-earned knowledge in something marketable to play along and be reassuring about their own expertise in it?

There is plenty of critique in the community but it’s usually done in private. It doesn’t pay to be on Apple’s bad side and it’s a promotion opportunity to advocate for the newest and shiniest. Also, experience shows that you need to look at Apple with a multi year lens especially nowadays. Sometimes it takes them a couple of years to get things right.
> It doesn’t pay to be on Apple’s bad side and it’s a promotion opportunity to advocate for the newest and shiniest.

This tends to be overestimated. There's rarely a good reason to fear criticism. Apple is too huge to notice you, unless you're famous yourself. Also, Apple is a very bureaucratic organization especially now. The App Store editorial team is in its own silo and doesn't necessarily pay attention to this, and isn't influenced by other teams within Apple (except when top executives step in, of course).

Ironically, the rational fear of criticizing Apple comes not from Apple retribution but rather from all the random little Apple fans jumping all over you for criticizing Apple.

Thanks. I think the bad experience was partly my fault. When I picked iOS and SwiftUI, I think I extrapolated too much from the overall fit&finish of the user-visible iPhone universe, and consequently didn't vet SwiftUI (and some of the more general barrel aspects) as much as I should've.
A sad truth is, the higher end of fit and finish on iOS almost always includes writing or hacking about at a lower level than one “should be”.

And SwiftUI is at least one level above that, so it’s going to be some time before it’s stable enough to get that spit and shine properly.

I’m off to muck about in the internal view hierarchy of a navigation bar to animate its button label..

That’s also the beauty of iOS, that you can go down levels as needed to get that power and flexibility.
pfft. The moment you accuse the "other side" of "fandom or Stockholm Syndrome", just because they don't constantly whine about something you dislike, you lost my respect.

You've already made up your mind if you're just going to slap such labels upon anyone who disagrees. Frank critique doesn’t thrive in echo chambers, and your preemptive polarization is just as guilty of such bias, just in the other direction.

What term should we use for your camp? "Haters?" "Lazy devs who don't bother to learn the intricacies of a new platform and expect stale knowledge they studied 10 years ago to apply everywhere?"

Electron is that way and have a nice day.

> Your comment is refreshing.

jamil7's GP comment was literally 2 sentences just saying "I'm disappointed, half-baked, bugs."

Disappointed how? Half-baked how? No details, just a string of some negatives and that's enough to make you happy. "Someone who agrees with me! Everyone else must be an Impostor!" (little Among Us reference there)

SwiftUI is a monumental project. Does any serious developer with real-world experience expect long-standing technologies like AppKit/UIKit/Cocoa/etc. to be completely supplanted within 2 years?

Any developer worth their bits would immediately notice the extensive support for incrementally adopting SwiftUI in legacy projects, or selectively falling back to existing tech in SwiftUI projects. You’re not supposed to go all-in if you're not fully comfortable with it, or if it doesn't serve all your needs yet.

And anyone even casually glancing at Apple SDKs will sense that this -is- the future. It's honestly fucking amazing to be able to target macOS, iOS, iPadOS, tvOS, watchOS and soon the rumored AR glasses with like 70% or more of the same code. Best of all, it not just spits out native widgets on each device (unlike Flutter or Qt), but also automatically adapts to the paradigms of each form factor (like navigation pages on phone/watch/TV versus sidebars on Mac/iPad).

Not to mention the rich support for adding internationalization and accessibility features to your app at a low cost, something that other major frameworks and companies generally ignore.

Yes, there are bugs. Yes, the documentation is appalling in many places. Yes, Apple doesn't communicate very well.

But hot damn, SwiftUI is the most refreshing UI framework I've seen since WPF, which Microsoft didn't even dogfood as much as Apple has done with their tech (both Swift and SwiftUI are already being used in core features of their OSes).

Shit that would take me a week on other frameworks I can now throw together in a day with SwiftUI, live previewing and incrementally improving and targeting multiple devices as I go.

I am not going back to any other framework. I would rather put my projects on hold if SwiftUI cannot handle them in its current state, than the other way around. The grass may seem greener on the other side for now but only because it's growing from a pile of rotting cow turds.

How's that for Frank Critique

So I will just respond to the parts regarding my original comment. You're right I didn't put any details in but in my further comment in this thread I mention that I'm using it a lot and have been since it's annoucement. I wouldn't have introduced it to my apps if I hadn't thought it was a promising piece of tech and I agree it is the future I'm not simply dismissing it out of ignorance, I've used it a lot and I'm disapointed because of the potential I see in it. The interop with UIKit is appreciated and I'm not asking for something as fully featured or mature as UIKit in 2 years, what I would have liked to have seen from this years WWDC however was a refinement and bug fixes of pieces that we already had.

Fundemental building blocks of SwiftUI are broken and have been since it's annoucement, List, NavigationView and NavigationLink for example – these are the basis of SwiftUI apps and need attention from Apple developers, I've reported bugs, memory leaks and performance issues with these and they've been acknowledged, maybe they fix them during iOS14's lifecycle but maybe not. We got some much needed features at this years WWDC but I would have also liked to see these fundementals addressed and maybe even rethought (navigation). It's not like we're talking about a volunteer open source project here, we're talking about the future flagship UI framework for 2 trillion dollar company. Run and profile Apple's own Fruta example app if you want to see what I'm talking about.

When it works, then yes like I said I can't imagine a faster way of building for Apple platforms. But right now I would warn others not to adopt it at any meaningful scale for another 2 years.

I see it like Swift itself, which took at least 3 years to fully come into its own.

Apple's lack of documentation and communication doesn't help; the best resources have been from fellow developers who were groping around in the dark like the rest of us and managed to figure things out by themselves. [0,1]

But again, I've already been able to do many things in SwiftUI that I don't even want to attempt in AppKit/UIKit/other frameworks.

Right now I think it's good enough for small apps or personal convenience tools. One surprising application for it is in games, where it actually works quite well, compared to all the other alternatives for drawing scalable/animatable HUDs and text etc. [2]

In an year or two I don't think anyone would willingly choose to fumble around with legacy frameworks if they want to target phone, tablet, computer, watch, TV and glasses all with one codebase.

[0] https://swiftui-lab.com

[1] https://swiftwithmajid.com

[2] https://twitter.com/InvadingOctopus/status/12792872846265794...

Curious how it compares with other reactive mobile frameworks like Jetpack Compose (which my colleague says is not at all ready for primetime) and Flutter (which he says is great). Any thoughts?
Conceptually it’s great and when it’s more stable I can’t imagine a faster way of building a cross platform Apple app that looks and feels correct. Styling a react native app felt tedious in comparison. Jetpack Compose appears to be going in a similar direction but last I checked it’s a long way off as you mention. Flutter is interesting but I have very limited experience, I was initially turned off by dart and the heavy focus on Android. I keep hearing positive things on HN and from other people though so I want to give it a another proper go. Overall it’s a bit of an awkward time for mobile development.
Thanks for the response. I have some personal experience with React Native which feels like a dead end to me. We've been building our apps with our small team with Swift (not SwiftUI) and Kotlin on Android, but the difficulty in keeping feature parity and UI consistency across platforms has tempted us to try Flutter, but as you say we're worried about how well the iOS widgets are replicated, also the accessibility story on Flutter seems not great, which is a moral problem for us as we don't want to exclude people with disabilities.
Why do you feel React Native is a dead end? I've built apps of all sizes with it and had a good amount of success. I love Swift as a language, but building the same app across platforms (Android/iOS) always feels so wasteful.
Background: I worked on the NFL mobile app and then worked on a search engine app both of which were in React Native. Specifically I worked on the team that did the developer tooling side for other teams. I made it so experienced JavaScript developers who had no experience with native mobile could create features more easily. Both get millions of downloads.

React Native is a pain to work with when the scope of your app becomes any larger than an agency level project (e.g. an app for an event that's only going to be used one weekend).

Once you start getting into requirements for a prime time production app (setting up APM tool, setting up tracking, setting up Google Analytics, native specific features that don't have a React Native hook yet) React Native is an extra layer of abstraction that slows you down. The experienced native developers hate working with it because they'd rather just use the related native platform themselves, but at the same time for any slightly complicated app you still need their expertise. Also, out of the box animations in React Native is difficult to work with, especially with less experienced developers, so you end up having to do a variety of work arounds to get animations between screens to look nice which you'd get out of the box just using Kotlin/Swift.

In 2020 if I needed to make an app quickly, cheaply, that worked on both platforms, I'd make a great mobile website and wrap it in a native shell. Any screen that needed a little bit extra "magic" I would do 100% native code for both platforms. This also allows you to ship updates to screens as you go without a complicated "codepush" JavaScript setup, as it's just a webview on the other end.

I'm still maintaining the React Native search app now, it works fine, but if we need to create an iOS version of it I'd definitely pitch doing it in native code.

I’ve just been building an app using react native (for web). We built the web app first and had it responsive and designed to match mobile interactions from the start (a stack view that keeps state) and it’s been quite nice. The other day went to get it running on native and was pleasantly surprised - was able to get all the main screens working smoothly and well in a matter of days.

Compared to SwiftUI it was far easier and even faster. Granted, I’ve worked with React a lot. But it’s really quite nice, I’m impressed with the whole ecosystem and how it’s grown.

Is React Native also OK from an accessibility point of view?

I'm just starting to work on apps and I feel the same moral imperative, but have no special love for Xcode &co.

It is not going to be as good out of the box as a native iOS app, but it is is workable with a little bit of effort. Unlike Flutter, react native does not have a fundamental architecture that makes accessibility tricky.
Accessibility is important, have you checked out the flutter docs? https://flutter.dev/docs/development/accessibility-and-local...