I have a List
with some row
s and some Button
s. I want to play different sounds for each button.
struct ContentView: View {
let rows = Row.all()
var body: some View {
List {
ForEach(rows) { row in
HStack(alignment: .bottom) {
ForEach(row.cells) { cell in
Button(
Image(cell.imageURL)
.resizable()
.scaledToFit()
)
.onTapGesture {
//playAudioAsset(cell.imageURL + "Sound")
print(cell.imageURL)
}
}
.buttonStyle(PlainButtonStyle())
}
}
}.padding(EdgeInsets.init(top: 0, leading: -20, bottom: 0, trailing: -20))
}
}
Even this simple print
doesn't work. :(