Moving Mac Cocoa to SwiftUI?

Is there a tutorial for converting a Macintosh Objective-C Cocoa app to SwiftUI?

Replies

There are a lot of tutorials on how to create SwiftUI code.

Such as:

h ttps://www.raywenderlich.com/3715234-swiftui-getting-started


I do not know any that deal explicitely with conversion.

For conversion, you'll have both the conversion from obj -> Swift in UIKit and conversion of UIKit -> SwiftUI, all at once.


How complex is your app ?

Is it storyboard based or xib based (closer to SwiftUI)

Why do you need to convert ?


In such case, it could be better to use the objc app as a spec for the new design, and rebuild from scratch in SwiftUI.

We have a vertical-market app with a lot of C++ code, and not a simple interface. We were not able finish the Cocoa 64-bit update in time for Catalina. It probably needs another year to finish. SwiftUI made us concerned about the long-term future of Objective-C and Cocoa, so we put it on hold and decided to focus solely on Windows for now.


Apple seems to only publicize SwiftUI these days, hence the interest. A total GUI rewrite would be too much- at least with Cocoa we can use Objective-C++ and keep some of the C++ controller code.


Is there a long-term blueprint for Cocoa's future? We have looked for something definitive from Apple but didn't find anything.