How can I add a button to my List cell?
var body: some View{
List {
VStack {
Button(action: {
print("Hello, World!")
}, label: {
Text("Hello, World!")
})
Text("Something irrelevant")
}
}
}
The above prints Hello, World! when I tap Hello, World!, but also when I tap Something irrelevant. I only want it to happen when tapping the button, how would I go about doing this?