Since iOS 18.1, the color of Alert buttons has been affected by the tint modifier.

I used .tint(.yellow) to change the default back button color. However, I noticed that the color of the alert button text, except for .destructive, also changed. Is this a bug or Apple’s intended behavior?

Thank you!

Below is my code:

// App
struct tintTestApp: App {
    var body: some Scene {
        WindowGroup {
            MainView()
                .tint(.yellow)
        }
    }


// MainView
var mainContent: some View {
        Text("Next")
            .foregroundStyle(.white)
            .onTapGesture {
                isShowingAlert = true
            }
            .alert("Go Next View", isPresented: $isShowingAlert) {
                Button("ok", role: .destructive) {
                    isNextButtonTapped = true
                }
                Button("cancel", role: .cancel){}
            }
    }

And this also occurs in iOS 18.1 and 18.1.1!

I'm seeing similar issues, though I'd note that I think the example here needs to include a NavigationStack around mainContent to exhibit the behavior?

Since iOS 18.1, the color of Alert buttons has been affected by the tint modifier.
 
 
Q