3

I want to drop annotation pins on a mapView with animation. I have tried with below code but it is not working.

anView = MKAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
            anView!.canShowCallout = true
            anView!.animatesDrop = true
Janak LN
  • 118
  • 1
  • 15

1 Answers1

0

It might be that you want to set the anView!.image = UIImage(named:"your-image") if you are using an MKAnnotationView.

If you are looking to just use the standard pin similar to apple maps, then you will want to use MKPinAnnotationView

Otherwise you may want to check out this SO answer

You will also want to make sure that you are initialising and returning the view from within this delegate method.

func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView!
Community
  • 1
  • 1