I am trying to have a list which displays all RoundRow’s and depending on which is clicked, a sheet is presented. The problem is no matter which row you click, the same sheet is always presented.
Not sure if there is a better way to do this or if I have done something wrong, any help appreciated.
ForEach(modelData.rounds) { round in
Button {
roundShow.toggle()
} label: {
RoundRow(round: round)
}
.sheet(isPresented: $roundShow) {
RoundDetail(round: round, profile: modelData.profile)
.presentationDetents([.fraction(0.999)])
}
}
New contributor
StingRox is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.