|
I have multiple buttons in an HStack in SwiftUI 2 (iOS 14). When i tap on a single button, the whole stack gets highlighted and the actions for ALL of the buttons gets executed.
So if I tap on the Call button not only does it bring up the Calling UI but it navigates to the Schedules Text (second option.) Is this a Swift 2 bug that I should be filing a Feedback on or am I doing something wrong here? |
|
Was able to put this view into an XCode 11 proect and it operates the same way. So the question is, how to I limit the execution to the tapped button's action when there are multiple buttons in an HStack? I tried setting the .contentShape (Rectangle()) on each button but that didn't help. |
|
|
|
I just lost 3 days because because the action triggert a backend function and I was looking there! Thanks so much |
|
|
|
I almost went down a rabbit hole with this problem. Happy that it has a quick fix. Thank you. |
|
|
|
|
|
SPONSORED Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.