Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Long press gesture on SwiftUI's Map View (watchOS)

Hi there,

I’m developing a watchOS app using SwiftUI, and I want to allow users to interact with the map using the panning gesture and also drop waypoints by long pressing anywhere on the map—just like in the built-in Apple Maps app on watchOS, where a long press drops a pin and panning still works seamlessly.

However, with SwiftUI’s Map, any attempt to attach a gesture other than .onTapGesture (such as LongPressGesture or DragGesture) seems to block the built-in map interactions, making panning impossible.

Is there a supported approach to detect long press gestures anywhere on the map while still allowing all standard map interactions (as seen in Apple Maps on watchOS)? Or is this something only possible with private APIs or internal access?

Any guidance or best practices would be greatly appreciated!

Thank you!

Accepted Answer

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))
Long press gesture on SwiftUI's Map View (watchOS)
 
 
Q