3 ms·
> I would not advise a new developer to learn AppKit at this point in time. I've been contracting on a "modern" mac app in SwiftUI for the last few months, one
by jamil7 5y ago
> I would not advise a new developer to learn AppKit at this point in time.
I've been contracting on a "modern" mac app in SwiftUI for the last few months, one of the issues I see is that you can't actually get that far without AppKit right now unless you have the luxury of supporting only the latest macOS. Even then people often just don't upgrade their OS until they buy a new computer so you're stuck with whatever version of SwiftUI. It's a bit of a weird time for macOS development.
- Turing_Machine 5y agoI like SwiftUI a lot, but IMO it's not really ready for primetime yet, while trying to do something partly in SwiftUI and partly in UIKit is ugly, ugly, ugly (again, IMO).
- bartvk 5y agoWhy do you think it’s ugly? What makes it so? I’ve bridged several UIKit components into SwiftUI and it’s been fine. You have to be careful with Auto Layout, my approach was to divide into separate UIView and then wrap those in UIViewRepresentable, thus leaving the layout to SwiftUI. But that was the main thing to keep in mind.
- windpower 5y agoI was recently contracted to help with a (very small!) Mac app written in SwiftUI where they had hit a hard wall on implementing a couple fundamental UI features and needed that part of the UI rewritten in AppKit. "That part of the UI" is about 80% of the surface area of the apps' main window. (Worth noting that the app current deploys to macOS 12, so even the latest deployment target isn't good enough to get us there.) AppKit may go away eventually, but _today_ it's still required to write a good Mac app even if you can use SwiftUI for large portions. My experience on this project has also taught me that AppKit can be made to play quite nicely with SwiftUI. The AppKit code is encapsulated well, and from the outside gets instantiated and included exactly as if it were a SwiftUI component.
- jamil7 5y agoThis essentially mirrors my experience however the codebase is more around 50-50 split AppKit / SwiftUI, most controls we tend to use AppKit and layout and display SwiftUI. I don't actually think the integration is too painful, layout can be a little weird sometimes where the two worlds awkwardly join but you can work around most issues there.