For anyone struggling with the same issue, here is how I managed to make it work:
.gesture(LongPressGesture(minimumDuration: 0.25)
.sequenced(before: DragGesture( minimumDistance: 0, coordinateSpace: .local))
.onEnded { value in
switch value {
case .second(true, let drag):
longPressLocation = drag?.location ?? .zero
guard let coordinate = proxy.convert(longPressLocation!, from: .local) else { return }
// Use retrieved coordinates
default:
break
}
})
.highPriorityGesture(DragGesture(minimumDistance: 10))
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: