I have added an mkpinannotation in an mkmapview.
I would like to move the pin to the place i tap on the mkmapview.
Is there an example anywhere?
Help appriciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First, add the gesture recognizer to the map view:
Next, implement
shouldRecognizeSimultaneously:WithGestureRecognizer:and returnYESso your tap gesture recognizer can work at the same time as the map’s (otherwise taps on pins won’t get handled automatically by the map)Finally, implement the gesture handler:
In this way you can get the Latitude and Longitude for location which you touch on the Map and once you get latitude and longitude you can easily drop a pin in to that location.