Search code examples
macosswiftuimac-catalyst

SwiftUI NavigationSplitView sidebar button location


I'm trying to use the new NavigationSplitView in SwiftUI but somehow, the Sibebar button renders differently between a Mac and Mac Catalyst

enter image description here

var body: some View {
    NavigationSplitView {
        Text("Hello, world!")
    } detail: {
        Image(systemName: "globe")
            .imageScale(.large)
            .foregroundColor(.accentColor)
    }
}

With Mac, the Sidebar Button renders on the toolbar enter image description here

With Mac Catalyst, it renders on the sidebar. My Mac Catalyst Interface is already set to Optimize for Mac enter image description here

I'm wondering if this is just a bug in Mac Catalyst?

or if not, how can I make the Mac Catalyst sidebar button show like the Mac build? I've already experimented with .toolbarRole but it seems it has no effect on the sidebar button.


Solution

  • The latest macOS and Xcode Beta 4, Mac Catalyst now properly displays the sidebar button:

    enter image description here

    It was a bug after all.