Delay Gestures in SwiftUI

Viewed 945

I'm creating a complex view that contains a ScrollView with draggable elements in it. I use DragGesture() for each element to implement dragging.

My Problem

Whenever I touch down an element, its DragGesture will be activated immediately and the ScrollView will not be scrolled when the touch is moved.

My Goal

I would like to add a time delay (say 1 second) for each DragGesture, such that when the user moves his touch on an element within that time, the ScrollView will be scrolled, but when he touch down an element for that time then move his touch, the element will be dragged.

0 Answers
Related