Oh I found out another way around my bug
my bug is that my todo list app’s done variables sometimes gets larger then my total todos when I delete one because I minus total by 1 but forgotten the done variable
Your dismiss dismisses your ContentView
another better way is to create a separate View
struct SheetView: View {
@Environment(\.dismiss) var dismiss
var body: come View {
...
Button {
dismiss()
} label: [
...
}
}
}
Then it'll work.
sth().sheet(...) {
SheetView()
}
Oh I found out another way around my bug
my bug is that my todo list app’s done variables sometimes gets larger then my total todos when I delete one because I minus total by 1 but forgotten the done variable
Your dismiss dismisses your ContentView
another better way is to create a separate View
struct SheetView: View {
@Environment(\.dismiss) var dismiss
var body: come View {
...
Button {
dismiss()
} label: [
...
}
}
}
Then it'll work.
sth().sheet(...) {
SheetView()
}