|
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 Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
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.