Hacker News new | ask | show | jobs
by mostlysimilar 1227 days ago
What sort of complex things are they unable to do? Is there any recourse? Can you use SwiftUI for the majority and dip into something lower level when needed?
3 comments

SwiftUI's weakness on macOS and to a lesser degree iOS is that it's difficult to fine-tune things to the extent that many longtime Apple platform devs traditionally have. It can usually meet the base case but it makes honing in on the fine details and achieving a high level of polish cumbersome.

There's also some things, particularly on macOS, that you're going to need to drop down into AppKit to do, which is possible thanks to NSViewRepresentable/UIViewRepresentable, but a bit frustrating is necessary.

Personally speaking I'm still limiting usage of SwiftUI to views that are either simple or don't have much in the way of user interaction. It's decent at that, but for most other things I'm using plain old AppKit/UIKit. SwiftUI is still green compared to AppKit/UIKit's multi-decade legacy, so hopefully it will improve in the coming years.

To give a quick example: in swiftui for ios, you can not change the spacing between list sections
Was looking at making something that would interact with SystemConfiguration.framework and registers itself on the DynamicStore's callback (something akin to dns-heaven[1]). From the introductory tutorials included with xcode I have no idea what is the equivalent to applicationDidFinishLaunching() where this kind of things would be put. It looked like maybe BackgroundTask is what I'm looking for, but it seems arbitrarily limited on macOS to an urlsession, whatever that is ?

[1]: https://github.com/greenboxal/dns-heaven/