@Claude31, I am app like that but it is not work,
` Button(action: {
showingAlert = true
}) {
Text("delete")
}
.alert(isPresented:$showingAlert) {
Alert(
title: Text("Are you sure you want to delete this?"),
message: Text("There is no undo"),
primaryButton: .destructive(Text("Delete")) {
self.delete(item: data)
},
secondaryButton: .cancel()
)
}`
@Claude31, it is delete list item, but delete randomly, when I meet with this error, when I used alert, it throw this error, I guess problem is start with .alert function
@Claude31, it is not same question, I mean .alert not work for two button, it is just work for one, for example it delete all row, but for singel row it is not work, the problem is due to I have two .aler dialog, I have to use it with switch case I guess, but how?
@Claude31, how I will use self.delete(item: data), and self.datas.removeAll() inside of the here ` .alert(item: $info, content: { info in // 5
Alert(title: Text(info.title),
message: Text(info.message))
})`
@Claude31, I am app like that but it is not work,
` Button(action: {
showingAlert = true
}) {
Text("delete")
}
.alert(isPresented:$showingAlert) {
Alert(
title: Text("Are you sure you want to delete this?"),
message: Text("There is no undo"),
primaryButton: .destructive(Text("Delete")) {
self.delete(item: data)
},
secondaryButton: .cancel()
)
}`
@Claude31, it is delete list item, but delete randomly, when I meet with this error, when I used alert, it throw this error, I guess problem is start with .alert function
@Claude31, it is not same question, I mean .alert not work for two button, it is just work for one, for example it delete all row, but for singel row it is not work, the problem is due to I have two .aler dialog, I have to use it with switch case I guess, but how?
@Claude31, how I will use self.delete(item: data), and self.datas.removeAll() inside of the here ` .alert(item: $info, content: { info in // 5
Alert(title: Text(info.title),
message: Text(info.message))
})`