Live data from Hacker News

Why I quit using SwiftUI

chsxf.dev

1–10 of 257 posts

Re: Why I quit using SwiftUI

#2
SwiftUI is a big opportunity that Apple's not investing enough in, IMHO. It's good tech, and the reactive approach is excellent for many typical view-based needs, but at the same time the docs are terribly lacking at how to handle any kind of edge cases.

Success to me looks like steering clear of SwiftUI for now, and advocating for Apple to hire documentation editors/leaders who can 1) create SwiftUI documentation of code examples for how to escape out of SwiftUI to handle more-complex cases, and 2) accelerate Xcode speedups of SwiftUI testing-and-instrumentation techniques such as View testing (e.g. ViewInspector) and integration testing vs. unit testing (e.g. reactive vs. dependency injection vs. extension tests vs. protocol tests etc.)

Re: Why I quit using SwiftUI

#3
I like SwiftUI even if most of my views are still NSViewRepresentables, it makes the application structure so much nicer and I don't have to use Interface Builder as much. I know you can use AppKit without Interface Builder but it's more annoying.

Re: Why I quit using SwiftUI

#4
post #2

SwiftUI is a big opportunity that Apple's not investing enough in, IMHO. It's good tech, and the reactive approach is excellent for many typical view-based needs, but at the same time the docs are terribly lacking at how to handle any kind of edge cases. Success to me looks like steering clear of SwiftUI for now, and advocating for Apple to hire documentation editors/leaders who can 1) create SwiftUI documentation of…

It's a great idea but not fully baked yet. My former colleague is using it for internal apps and it seems to work fairly well (UI is not fancy), but not for anything going into the high volume apps, which has much more complex behavior (designers are asking for stupidly complex UI). It's much better in the upcoming OS since they added better navigation, but requires the latest OS, which is not supportive for many companies who try to support back at least 1 year.

Will it ever be mainstream for iOS/MacOS? Maybe, if Apple would use it way more than they have so far, thus improvement by dogfooding. It is nice to build apps this way, but there are way too many bizarre gotchas still for most people unless you can live with more flexible designs.

Re: Why I quit using SwiftUI

#5
post #2

SwiftUI is a big opportunity that Apple's not investing enough in, IMHO. It's good tech, and the reactive approach is excellent for many typical view-based needs, but at the same time the docs are terribly lacking at how to handle any kind of edge cases. Success to me looks like steering clear of SwiftUI for now, and advocating for Apple to hire documentation editors/leaders who can 1) create SwiftUI documentation of…

> but at the same time the docs are terribly lacking at how to handle any kind of edge cases.

I agree that Apple’s documentation needs help (this year’s improvements are a nice step) but can we really expect them to provide extensive documentation for handling edge cases (you’re telling me UIKit docs offer that)?

Re: Why I quit using SwiftUI

#6
> I profiled the whole thing and discovered several things. First, the view provided by the selectable object was completely recreated with every redraw. I gained some performance back by caching it, but things remained barely usable.

That... is exactly the same thing with React. You don't notice everything is redrawn until suddenly everything is unbearably slow. And then it's useMemo etc. galore.

I'll withhold my judgement on SwiftUI for now though.

Re: Why I quit using SwiftUI

#7
People nowadays praise Apple for their hardware, mainly their silicon - not their software. Maybe it's time for Apple to shake things up and promote someone else to VP of Software engineering?

Re: Why I quit using SwiftUI

#10
The entire view shouldn’t be redrawn but certain views only (not the entire tree) maybe look into prevent entire view from being redrawn itself (React does this too and you can prevent redraw without utilizing useMemo by understanding it’s internals)
Post reply on HN