Hello,
is there anyone who can tell me how to use a popover in a loop with the isPresented variable?
Currently I have something like this:
ForEach(0…<30, id: .self) { index in
Button {
presentPopover = true
} label: {
ZStack {
Rectangle()
.fill(.white)
.frame(width: 180, height: 55)
.cornerRadius(5)
Text("Runde \(index + 1)")
.bold()
.font(.system(size: 24))
.foregroundColor(.black)
}
}
.popover(isPresented: $presentPopover) {
GameSheetPopOverView(points: $points)
}
}
But here nothing happens when I tap on the button. This works only if I have single elements and a isPresented variable for each element.
Thanks in advance.