Only in Xcode15 + iOS 17, SwiftUI ToolbarItem > Button > Image's color is not set

struct ContentView: View {
    var body: some View {
        Text("Hello, world!")
            .padding()
            .navigationTitle("Title")
            .toolbar {
                ToolbarItem(placement: .cancellationAction) {
                    Button {
                    } label: {
                        Label {
                            Text("Button Text")
                        } icon: {
                            Image("commonIcoClose")
                                .renderingMode(.template)
//                                .foregroundColor(.red)
                                .foregroundStyle(.red)
                        }
                    }
                }
            }
    }
}

Above code should set Button's Image color to red but in Xcode15(15A240d), color is not applied and just set to default blue.

In iOS 15, 16 in Xcode 14.3.1 and iOS 15, 16 + Xcode15(15A240d) works fine(image's color is set to red).

So if i want to set color to red, I should use .tint like below.

struct ContentView: View {
    var body: some View {
        Text("Hello, world!")
            .padding()
            .navigationTitle("Title")
            .toolbar {
                ToolbarItem(placement: .cancellationAction) {
                    Button {
                    } label: {
                        Label {
                            Text("Button Text")
                        } icon: {
                            Image("commonIcoClose")
                                .renderingMode(.template)
                        }
                    }
                    .tint(.red)
                }
            }
    }
}

Is this change intended? Or is it a bug?

I had this issue as well - .foregroundStyle/.foregroundColor stopped working on buttons when building my app in xcode 15.

This used to work fine, does not anymore:

                                Button(action: {openURL((state.tabUrlRequest?.url!)!)}, label: {
                                    Label("", systemImage: "safari")
                                }).foregroundStyle(.white)

Same Problem here, and also the animation on the label of a button is not working anymore in iOS 17. The items in toolbar placement .keyboard are also not showing up anymore. The toolbar in iOS 17 broke a lot of former working code.

Only in Xcode15 + iOS 17, SwiftUI ToolbarItem > Button > Image's color is not set
 
 
Q