SwiftUI for Mac on Big Sur
After a lot of testing, several days of frustration and help from Jordan Singer with his mail-swiftui-sample project, I was finally able to work this out. The difference is that the initial view has to specify what comes next as well as what it is displaying.
[…]
In the old style SwiftUI apps which were wrapped in AppKit, the menus were in a storyboard that you could edit. Now you add
commands
to the app’sWindowGroup
to alter the menus.[…]
With menus and toolbars, there is a heap of extra code added to certain views. I would love to be able to extract that into its own function or view modifier. I was able to extract the toolbar, but I am not sure how to do this with menus yet.
Previously: