Hacker News new | ask | show | jobs
by troupo 847 days ago
> There probably isn't any reason to start a new app or library with anything other than Swift.

Unless you do anything for MacOS and care about MacOS. Most Swift UI apps I've seen feel foreign on MacOS in innumerable ways.

2 comments

You can use AppKit in Swift just like you can use UIKit on iOS. There is no requirement to use SwiftUI when creating a macOS swift app.
Yeah the wrapper is the same, it’s just NSView instead of UIView and the like. But the API is wrapped just as well.
Thanks for that perspective. I haven't done any MacOS development.
Since Swift UI is iOS-first, when the apps get ported to MacOS, they bring a lot of mobile-isms: the views and animations are often wrong, the controls are often wrong (like even the Apple's own settings app breaks a lot of established platform conventions and Apple's own HIGs), integration with system services is often incomplete (like proper keyboard shortcuts, I can't set a shortcut for Conversations->Delete in Messages anymore) etc.

Because of that I've seen people discuss that they have to reach for AppKit and/or ditch SwiftUI and got all in with AppKit, and that is easier to do from Obj-C.

> "people discuss that they have to reach for AppKit and/or ditch SwiftUI and got all in with AppKit, and that is easier to do from Obj-C."

You can fairly easily port UIKit apps to macOS now with Mac Catalyst[1] No need to use SwiftUI to get those mobile-isms.

[1] https://developer.apple.com/mac-catalyst/

Also AppKit works perfectly well in swift. People just probably remember the ObjC versions of things better since that’s where this all started. But the naming is pretty standard if you remember the old calls.
Catalyst is just as bad IMO