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){}
}
}