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.

SwiftUI toolbar with IDs crash since macOS 15
 
 
Q