title: Swift - Changing Annotation Image Not Working
body: <p>I have followed other stack posts and tutorials in changing my annotations image to a custom one, but it does not seem to work. No errors or runtime errors appear, it's just that the annotation image does not change. </p>
  
  <p>Just by the way  I set a break point on the line <code>annotationView!.image = UIImage(named: "RaceCarMan2png.png")</code> and it shows that the line is being called, but yet nothing happens. I would really appreciate your help. Thanks.</p>
  
  <pre><code>func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -&gt; MKAnnotationView? {
      if annotation is MKUserLocation {
          return nil
      }
  
      let identifier = "MyCustomAnnotation"
  
      var annotationView = mapView.dequeueReusableAnnotationViewWithIdentifier(identifier)
      if annotationView == nil {
          annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: identifier)
          annotationView?.canShowCallout = true
  
          annotationView!.image = UIImage(named: "RaceCarMan2png.png")
  
      } else {
          annotationView!.annotation = annotation
      }
  
  
      configureDetailView(annotationView!)
  
      return annotationView
  }
  
  func configureDetailView(annotationView: MKAnnotationView) {
          annotationView.detailCalloutAccessoryView = UIImageView(image: UIImage(named: "url.jpg"))
  }
  </code></pre>