Case 1:- When I have multiple Buttons in a VStack, on clicking of any one of them, the action handlers of both the buttons executes immediately, this happens only when the VStack is a child of List. For eg-
List { VStack { Button(action: { print("A") }) { Text("Button A") } Button(action: { print("B") }) { Text("Button B") } } } Here when you click on any one Button(say Button B), the o/p is:- A B
Case 2:- Try that with just a VStack, it works fine. For eg-
VStack { Button(action: { print("C") }) { Text("Button C") } Button(action: { print("D") }) { Text("Button D") } } Here when you click on any one Button(say Button D), the o/p is:- D
I am new to iOS programming, please help me understand where I am going wrong or is it an issue with SwiftUI?