Thank you to all above for their help with this. I have managed to get the original single tap and longPressGesture working in my app using the following code.
That said, I trust Apple engineers will still resolve the fundamental issue of .onTapGesture not recording a callback. Whilst I am not so concerned about the LongPressGesture, using either spatial or drag inside a simultaneousGesture for what is a single tap feels uncomfortable and a possible future vulnerability...
.simultaneousGesture(
DragGesture(minimumDistance: 0).onEnded({ value in
print("Map tapped")
if let coordinate = mapProxy.convert(value.location, from: .local) {
self.model.selectedMapLocation = coordinate
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
if self.model.isShowingMickDescription != true && self.model.isShowingBeaconDescription != true {
self.isShowingCreatePinFromMap = true
}
}
})
)
.simultaneousGesture(
LongPressGesture().onEnded({ value in
print("Long tap gesture")
if self.model.nearestPin != nil && self.model.subscribed {
self.selectedResult = self.model.nearestPin
withAnimation {
visibleRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: self.selectedResult!.dispLat, longitude: self.selectedResult!.dispLon), span: .nearestPinSpan)
cameraPosition = .region(visibleRegion!)
}
self.model.cameraPosition = self.cameraPosition // Used in Model to save camera position
self.model.isShowingMickDescription = true
}
})
)