I am struggling to unearth a standard way to drop a pin on a MkMapView based on a touch input. There probably isnt a standard way, but it is always worth asking. If I have to implement this myself is the best approach to add a Gesture Recogniser to pick up a tap on the map view.
-
This tutorial has lot more stuffs, it gives u what exactly want https://github.com/devinross/tapkulibrary – Splendid Mar 03 '11 at 14:57
2 Answers
Yes, you can use a UILongPressGestureRecognizer
to do this.
This previous answer of mine has details with sample code:
How to add a push pin to a MKMapView(IOS) when touching?
To animate the drop, in viewForAnnotation
, return an MKPinAnnotationView
with animatesDrop
set to YES.

- 1
- 1
-
Yeah I saw your post before, I though this would be the only way to do it. – botptr Mar 04 '11 at 09:58
I know that the Maps app has a separate button (under the curl of the map) that drops a pin. Hence that is kind of how I do it (though not under the map curl). I have not read anywhere that there is a standard but I have not read all 12,000 GB of documentation (ha ha). I would say to check out some of the "standard" apps like Maps and follow what they do just to be consistent. I know that typically a double tap zooms the map so I'm not sure that I would use that. Just my $0.02...

- 494
- 2
- 4
-
-
Well I never knew that, thanks for the info! Then maybe that would be how I do it and maybe I'll re-work mine to do the same. – Merky Mar 03 '11 at 18:09