Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The Drag Gesture in SwiftUI may fail to work when combined with a ZStack within a ScrollView and ForEach loop because the ZStack is not a scrollable element, so the gesture recognizers may conflict with each other. The Drag Gesture may be recognized by the scroll view instead of the ZStack, resulting in unexpected behavior. To fix this issue, you can try adding the gesture recognizer to the scroll view directly or using a different layout method that properly handles gesture recognition.