I do some tests. If I just make a button like this:
Button(action: {
self.showActionSheet = true
}) {
Text("Click")
}.actionSheet(isPresented: $showActionSheet) {
ActionSheet(title: Text("This is a test"))
}
It works!
But if I put it in NavigationView
, the bug appears! The ActionSheet
will pop up again when I clicked the Cancel
.