News for hackers. Stuff that matters.
Re:9 years of Apple text editor solo dev by ChrisMarshallNY on Friday January 05, 2024 @10:26AM (#38880018)
> Swift has come a long way and my guess is Apple has either embedded it into their platforms or added some fancy tree shaking for the binary.

It went ABI around Swift 5 or so.

I took a huge leap of faith, in 2014, and started using Swift, exclusively. It's turned out OK.

I'm not quite as positive about SwiftUI, though. I think it will work out, but it has a huge amount of catching up to do, if it is to replace UIKit/AppKit.

I'd be quite interested in Rich Siegel's take (the guy behind BBEdit). He's been at it, a while, as well.

Re:9 years of Apple text editor solo dev by jimbokun on Friday January 05, 2024 @11:32AM (#38880939)
When I tried using SwiftUI, the performance for scrolling through lists past a certain size was very painful. I guess there were ways to mitigate this slowness, but they were very unintuitive and did not give me confidence in the developers commitment to keeping apps snappy and responsive.

The APIs for NSTableView and NSCollectionView, in contrast, were always very responsive and performant when used in the default way.

All of this greatly reduced my trust in SwiftUI. Seems like they did not have performance in mind in the core design decisions of the framework, and only tested it on small data sizes.

Maybe things have improved since then.

Re:9 years of Apple text editor solo dev by jshier on Friday January 05, 2024 @11:48AM (#38881176)
No, List still has some awful performance cliffs unless you go out of your way to model your infinite lists in a way it can handle. There are some nice UI / NSTableView / CollectionView wrappers nowadays though.
Re:9 years of Apple text editor solo dev by interactivecode on Friday January 05, 2024 @12:42PM (#38881983)
The great strength of SwiftUI is that until they have caught up with UIKit and AppKit you can just drop down to those frameworks. So you can use SwiftUI in 95% of your app and where you run into limitions you can use the lowerlevel NSCollectionView for example. Whats even cooler is that inside that NSCollectionView you can just use SwiftUI views again.
Re:9 years of Apple text editor solo dev by mac-mc on Friday January 05, 2024 @03:26PM (#38884399)
That has some unique edge cases as we have been discovering when you interleave UIKit and SwiftUI together.

I kind of wish that SwiftUI was a clean break in some ways and did not depend on UIKit and avoid all the abstraction leak issues that have been arising as a result. I know that would never happen in practicality although.

Re:9 years of Apple text editor solo dev by lenkite on Friday January 05, 2024 @02:32PM (#38883610)
I wish Apple had stuck to Model-View-Controller instead of shoehorning React philosophy into their native UI framework. Personally, I find the "old-school" way of doing things far easier to follow and understand.
Re:9 years of Apple text editor solo dev by raydev on Friday January 05, 2024 @04:05PM (#38884930)
The existing UIViewController and how it's implemented breaks the model-view-controller pattern, so there was nothing to stick to.
Re:9 years of Apple text editor solo dev by dangwu on Friday January 05, 2024 @06:41PM (#38886617)
React is popular for a reason. Declarative UI is a million times easier to implement and maintain. If a total newbie had to learn UIKit and SwiftUI then pick one, they'd pick SwiftUI 100% of the time.
Re:9 years of Apple text editor solo dev by jimbokun on Monday January 08, 2024 @02:03PM (#38916534)
Until the input data gets larger and the performance grinds to a halt.
Re:9 years of Apple text editor solo dev by mromanuk on Friday January 05, 2024 @10:38AM (#38880167)
I've released a SwiftUI app, but was a nightmarish experience. They are experimenting and changing stuff to better serve SwiftUI philosophy, like the change from Combine to Observation. There were plenty of bugs and some of them difficult to debug like previewing screens on Xcode, sometimes it keeps crashing. When it works it's marvelous. I hope they can stabilize it.
Re:9 years of Apple text editor solo dev by airstrike on Friday January 05, 2024 @07:27PM (#38886952)
You can still use Combine in Swift, but I agree Observation in general feels inferior for all but the most mundane cases.

It's like you go through a SwiftUI tutorial placing @Published and @ObservedObject everywhere, and then once you're writing the app you realize what you need is Combine except you haven't learned that yet

Re:9 years of Apple text editor solo dev by lapcat on Friday January 05, 2024 @10:47AM (#38880278)
> I'd be quite interested in Rich Siegel's take (the guy behind BBEdit). He's been at it, a while, as well.

Looking inside the BBEdit app, I see some Swift in BBEdit.app/Contents/Frameworks/CandiedYams.framework, which appears to be a third-party framework (CFBundleIdentifier org.darkrainfall.candied-yams), but not much else.

Re:9 years of Apple text editor solo dev by ChrisMarshallNY on Friday January 05, 2024 @10:49AM (#38880303)
Not surprising.

I've been using BBEdit for about thirty years. It's been through many changes. I suspect that he's pretty conservative.

Re:9 years of Apple text editor solo dev by orenlindsey on Friday January 05, 2024 @10:56AM (#38880421)
SwiftUI is pretty good, I've been using to build an app. The big problem is navigation and state handling, it's not intuitive (although I never used AppKit or UIKit so I can't say if it's better or worse)
Re:9 years of Apple text editor solo dev by jshier on Friday January 05, 2024 @11:01AM (#38880487)
Yeah, you really need to combine SwiftUI with a dedicated architecture like PointFree's Swift Composable Architecture. It solves your state and navigation problems while adding dependency and testing solutions as well.

Apple's stubborn and bizarrely proud insistence on not providing the full solution here is very annoying.

Re:9 years of Apple text editor solo dev by bsaul on Friday January 05, 2024 @12:56PM (#38882164)
just had a look at Composable Architecture, and it looks like swiftUI being the equivalent of react, they faced the same problem and someone developed a redux in swift. Am i correct ?
Re:9 years of Apple text editor solo dev by jshier on Friday January 05, 2024 @01:02PM (#38882274)
Kind of, but without the reactive UI bits, since SwiftUI already provides that (they provide a way to publish state into the older frameworks as well). It's heavily inspired by Elm and React but doesn't match 1:1 with either.
Re:9 years of Apple text editor solo dev by jimbokun on Friday January 05, 2024 @11:33AM (#38880953)
> The big problem is navigation and state handling

Those seem like very basic features that a UI framework needs to get right.

Re:9 years of Apple text editor solo dev by jshier on Friday January 05, 2024 @11:50AM (#38881205)
Apple seems to think the UI frameworks should only focus on UI, and so overall arch is an afterthought. You can, of course, navigate and store state using the tools provided, but it's a pain to do so beyond local screens, where you have to manually pass things around, and you lose most testability.
Re:9 years of Apple text editor solo dev by interactivecode on Friday January 05, 2024 @12:47PM (#38882045)
You should give it an other go building on SwiftData and the new Observation API’s. They made leaps and bounds and it’s so much better now!

I’m having a lot of fun with it at the moment. If you stay within the bounds of how they encourage you to build the apps, you can just go go go and with very little work release a fast, stable, native app across all their platforms.

Re:9 years of Apple text editor solo dev by imbnwa on Friday January 05, 2024 @10:41AM (#38880194)
I follow the development of Swiftcord, A SwiftUI Discord client, on the developer's discord, and they almost constantly lambast how much is apparently missing or unstable between AppKit and the current version of SwiftUI, which has made it a struggle to get to feature parity with the official Discord client based on Electron cause lots of things you expect either have to be implemented by hand or just can't be done IIRC.
Re:9 years of Apple text editor solo dev by meindnoch on Friday January 05, 2024 @01:38PM (#38882787)
Why do they insist on making their life harder? Just use Cocoa...
Re:9 years of Apple text editor solo dev by luizsantana on Friday January 05, 2024 @02:38PM (#38883706)
Well, migrating swift versions was not too fun