-1

I'm using a mapView from MapKit.h. I have a mapView with some pins and I want to launch a function when I click on a pin. In android I used onMarkerClickListener method, and I don't know if I can do something like this with MapKit.h. Anyone can help me??

Alex
  • 23
  • 3

2 Answers2

1

Yes, there is a delegate method

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view

which will get called when you tap on the pin. for this you should set pin.canShowCallout = YES

for more details follow below link MKMapView MKPointAnnotation tap event

Community
  • 1
  • 1
Keshav
  • 2,965
  • 3
  • 25
  • 30
1

Here is below links can helps to reach your requirement with sample code.

http://jonathanfield.me/mkmapview-adding-pins-map-showing-annotations/

http://rshankar.com/how-to-add-annotation-to-mapview-in-ios/

simbesi.com
  • 1,539
  • 3
  • 17
  • 27