title: MapView doesn't show Annotations after adding viewForAnnotations
body: <p>so I am using MapKit for the first time and I am trying to show annotations with a callout.</p>
  
  <p>The annotations appear but as soon as I add the delegate function viewFor annotation (<code>func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -&gt; MKAnnotationView? {}</code>) the annotations do not appear anymore. Is there anything I am missing in that function ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I forgot to mention that the View Controller is the delegate of <code>MKMapViewDelegate</code></p>
  
  <pre><code>@objc func addAnnotationOnLongPress(gesture: UILongPressGestureRecognizer) {
  
          if gesture.state == .ended {
              let point = gesture.location(in: self.mapView)
              let coordinate = self.mapView.convert(point, toCoordinateFrom: self.mapView)
              //Now use this coordinate to add annotation on map.
              let annotation = MKPointAnnotation()
              annotation.coordinate = coordinate
  
              usf.fetchJSON(urlString: usf.setNewLocation(lat: annotation.coordinate.latitude, lon: annotation.coordinate.longitude)) { (data, success) in
                  if success {
                      annotation.title = data?.name
                      annotation.subtitle = "HAa"
                  } else {
                      let alertUI = self.usf.createAlertOK(title: "Something went wrong!", message: "Cannot get the current weather! \n Check your connectivity or try again later")
                      self.present(alertUI, animated: true, completion: nil)
                  }
              }
              let previousAnnotations = self.mapView.annotations
              if !previousAnnotations.isEmpty{
                self.mapView.removeAnnotation(previousAnnotations[0])
              }
              self.mapView.addAnnotation(annotation)
          }        
      }
  
  
  
      func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -&gt; MKAnnotationView? {
          if annotation is MKUserLocation {
              return nil
          }
          print("in viewFor annotation") // prints out
          let annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "TempAnnotationView")
          annotationView.canShowCallout = true
          annotationView.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
          self.mapView.showAnnotations(mapView.annotations, animated: false)
          return annotationView
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rShrF.png" rel="nofollow noreferrer"></a></p>