I have following LazyVGrid view in my code
LazyVGrid(columns: columns) {
ForEach(monthNames!, id: \.number) { month in
Text(month.name)
}
ForEach(balances, id: \.id) { balance in
Text(valueFormatter.string(from: balance.balance! as NSNumber)!)
.onTapGesture {
print(balance.balance!)
editActual = true
}
.sheet(isPresented: $editActual) {
ActualBalanceView(show: $editActual, year: selectedYear, month: selectedMonth, balance: balance.balance! as Decimal)
}
}
}
and if I tap on Text item ActualBalanceView shows always value from the first Grid column even if print command placed in .onTapGesture closure prints right value to console window. Any idea how to make ActualBalanceView showing tapped value?