mapView:rendererForOverlay delegate method never called when addOverlay is called on MKMapView
<p>I created a <code>MapViewController</code> class with a scene that has an <code>MKMapView</code> in the storyboard. The MKMapView has an outlet <code>mapView</code> to <code>MapViewController</code>, and the delegate is set to <code>MapViewController</code> in the storyboard. The <code>MapViewController</code> is a <code>MKMapViewDelegate</code>, and I implemented the optional delegate method <code>mapView:rendererForOverlay</code>, and some other ones. </p>

<p>In <code>viewDidAppear</code>, I call <code>addMapOverlay</code>, defined as:</p>

<pre><code>  func addMapOverlay() {
    let overlayRect = MKMapRectMake(
      44.97077, -93.2864435,
      0.1, 0.1)

    let coordinate = CLLocationCoordinate2DMake(44.97087, -93.2865435)

    let overlay = MapOverlay(coordinate: coordinate, rect: overlayRect)

    print("adding overlay with level...")
    mapView.delegate = self;
    mapView.addOverlay(overlay, level: .AboveRoads)
  }
</code></pre>

<p>Even though the delegate is set in the storyboard, I tried to see if would help if I set it here as well. (No difference.)</p>

<p>I implement the delegate methods as such:</p>

<pre><code>extension MapViewController: MKMapViewDelegate {

  func mapViewWillStartRenderingMap(mapView: MKMapView) {
    print("mapViewWillStartRenderingMap...")
  }

  func mapView(mapView: MKMapView, didAddOverlayViews overlayViews: [AnyObject]) {
    print("mapView:didAddOverlayViews...")
  }

  func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay)
    -&gt; MKOverlayRenderer {
      print("mapView:rendererForOverlay")

      if overlay is MapOverlay {
        let image = UIImage(named: "main_map_overlay")
        let overlayView = MapOverlayView(overlay: overlay, overlayImage: image!)

        return overlayView
      }

      return MKPolylineRenderer()
  }

}
</code></pre>

<p>I am supposed to see the UIImage in the mapView with the coordinates, but I don't. The problem is that <code>mapView:rendererForOverlay</code> never gets called. What am missing? My only output is:</p>

<pre><code>adding overlay with level...
mapViewWillStartRenderingMap...
</code></pre>