SwiftUI issue with onTap using Map using IOS 26

I have a sample that stop working on IOS 26, using the latest XCode and IOS sdk, the onTapGesture event is no longer happening. Maybe this is no longer the way to drop pins on the map.

Also not working on the iPhone 17 sim or iPhone 16 max pro device upgrading to IOS 26

Thanks, any help

Sample: import SwiftUI import MapKit import CoreLocation import Foundation

struct Pin: Identifiable { let id = UUID() let coordinate: CLLocationCoordinate2D }

struct ContentTestPinDropView: View { @State private var pins: [Pin] = []

var body: some View {
    MapReader { reader in
        Map(selection: .constant(nil)) {
            ForEach(pins) { pin in
                Marker("Pin", coordinate: pin.coordinate)
            }
        }
        .onTapGesture { screenPoint in
            if let coordinate = reader.convert(screenPoint, from: .local) {
                pins.append(Pin(coordinate: coordinate))
            }
        }
    }
}

}

Answered by DTS Engineer in 859521022

This is a known issue listed in the release notes. Please see this other thread with an existing discussion of the temporary workarounds available.

— Ed Ford,  DTS Engineer

Accepted Answer

This is a known issue listed in the release notes. Please see this other thread with an existing discussion of the temporary workarounds available.

— Ed Ford,  DTS Engineer

SwiftUI issue with onTap using Map using IOS 26
 
 
Q