SwiftUI toolbar with IDs crash since macOS 15

I understand this is a known issue, but it’s truly unacceptable that it remains unresolved. Allowing users to customize toolbars is a fundamental macOS feature, and it has been broken since the release of macOS 15.

How is it possible that this issue persists even in macOS 15.3 beta (24D5040f)?

FB15513599

import SwiftUI

struct ContentView: View {
    @State private var showEditItem = false
    
    var body: some View {
        VStack {
            VStack {
                Text("Instructions to reproduce the crash")
                    .font(.title)
                    .padding()
                Text("""
1. Click on "Toggle Item"
2. In the menu go to File > New Window
3. In new window, click on "Toggle Item" 
""")
            }
            .padding()
            
            Button {
                showEditItem.toggle()
            } label: {
                Text("Toggle Item")
            }
        }
        .padding()
        .toolbar(id: "main") {
            ToolbarItem(id: "new") {
                Button {
                    
                } label: {
                    Text("New…")
                }
            }
            
            if showEditItem {
                ToolbarItem(id: "edit") {
                    Button {
                        
                    } label: {
                        Text("Edit…")
                    }
                }
            }
        }
    }
}

Still experiencing this issue with macOS 15.3 Beta 3 (build 24D5055b).

I guess Apple’s focus has shifted to promoting TV shows and generating bogus news summaries, rather than addressing bugs in features that have been part of macOS since its inception 24 years ago.

So much for “the modern way to build apps is SwiftUI” slide in a recent WWDC video...

Still not resolved in 15.3RC (24D60). Like the SwiftUI engineers, I’m giving up. I’ll leave it to users who want customizable toolbars to contact Apple instead.

Still an issue with Xcode Version 16.3 beta 2 (16E5121h) and macOS 15.4 Beta (24E5222f).

Still an issue with macOS 26 beta 1 (25A5279m) and Xcode 26 beta 1 (17A5241e). At this point I assume this will never get fixed.

I literally just bought a new mac studio for the sole purpose of writing a mac desktop app. The very first thing I tried on day one was to write a simple sidebar with customizable toolbar. and it crashed instantly.

I'm really shocked this is a know issue and Apple has completely ignored it. Yes, I tried the remove: .sidebar hack, but the toolbar has so many bugs and it's impossible to add the toggle sidebar button and get it working with the customizer. everything goes crazy.

Sample app I prepared thinking someone might give this some attention: https://github.com/sgehrman/SwiftUIAppBugs

Apple developers have always been treated poorly. And Cocoa was also full of bugs. I had hoped swiftUI would finally work.

SwiftUI toolbar with IDs crash since macOS 15
 
 
Q