Trouble with Gesture Recognizers in SwiftUI on iPhone 14: Conflicting with ScrollView
I've been banging my head against this for hours. I need help solving After trying multiple solutions online, I still can't figure this out. I'm sure I'm missing something obvious here, but I'm trying to implement a custom gesture recognizer in a SwiftUI view on my iPhone 14 running iOS 17. The view contains a `ScrollView` that should allow both vertical scrolling and a custom tap gesture for a button. However, I'm encountering a problem where the tap gesture doesn't seem to register unless I scroll vertically first. When I tap directly on the button, it doesn't respond, leading to a frustrating user experience. I've tried implementing the `simultaneousGesture` modifier to combine both the scroll and tap gestures, but it doesn't seem to work as expected. Here's a simplified version of my implementation: ```swift struct ContentView: View { @State private var tapCount = 0 var body: some View { ScrollView { VStack { Text("Tap Count: \(tapCount)") .font(.largeTitle) .padding() Button(action: { tapCount += 1 }) { Text("Tap Me!") .padding() .background(Color.blue) .foregroundColor(.white) .cornerRadius(8) } .simultaneousGesture(TapGesture().onEnded { _ in tapCount += 1 }) .padding() } .frame(maxWidth: .infinity) } } } ``` When I tap the button, the expected tap count doesn't increment unless I scroll first, which indicates that the gesture recognizer for the button is being overshadowed by the `ScrollView`. I also experimented with changing the order of gestures and using `highPriorityGesture`, but the issue persists. I've looked through the documentation on gesture recognition in SwiftUI but haven't found a clear solution. Has anyone else faced this issue, or does anyone have suggestions on how to properly handle gesture conflicts in this scenario? Would using UIKit's Gesture Recognizers directly be a better approach? Any insight would be appreciated! This is part of a larger API I'm building. Is there a better approach? I'm working on a CLI tool that needs to handle this. Thanks in advance! For context: I'm using Swift on macOS. What am I doing wrong? What am I doing wrong? Any ideas how to fix this?