Anyone else notice that the DismissAction or PresentationMode will break accent color on sheets?
struct ContentView: View {
// Un-comment either of the below lines, and the tint color of SheetView becomes gray, rather than red.
// @Environment(\.dismiss) var dismiss
// @Environment(\.presentationMode) var presentationMode
@State var sheetPresented = false
var body: some View {
Button("Show Sheet") {
sheetPresented.toggle()
}
.sheet(isPresented: $sheetPresented) {
SheetView()
.accentColor(.red)
}
}
}
struct SheetView: View {
@Environment(\.dismiss) var dismiss
var body: some View {
Button("Dismiss") {
dismiss()
}
.foregroundColor(.accentColor)
}
}