title: Annotation callout not working Swift
body: <p>I'm trying to add a callout to my annotations in MapKit, but I cannot get it working after searching quite a bit online.</p>
  
  <p>This is how I am currently creating each annotation which works fine at the moment.</p>
  
  <pre><code>struct loc {
      let title: String
      let latitude: Double
      let longitude: Double
      let phone: Int
      //let subTitle: String
  }
  
  var locs = [
      loc(title: "New York, NY",    latitude: 40.713054, longitude: -74.007228, phone: 2334), //subTitle: "Sub title"),
      ]
  
  func placeAnnotations() {
      let annotations = locs.map { location -&gt; MKAnnotation in
          let annotation = MKPointAnnotation()
          annotation.title = location.title
          annotation.coordinate = CLLocationCoordinate2D(latitude: location.latitude, longitude: location.longitude)
  
          //annotation.subtitle = location.subTitle
          return annotation
      }
      mapView.addAnnotations(annotations)
  }
  </code></pre>
  
  <p>(I have a function which adds data to the array locs)</p>
  
  <p>And this is what I have got when trying to add a callout which isn't working.</p>
  
  <pre><code>func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -&gt; MKAnnotationView? {
      if annotation is MKUserLocation { return nil }
      let identifier = "pin"
      var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier) as? MKPinAnnotationView
      if annotationView == nil {
          annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: identifier)
          annotationView?.canShowCallout = true
          annotationView?.rightCalloutAccessoryView = UIButton(type: .infoDark)
      } else {
          annotationView?.annotation = annotation
      }
  
      return annotationView
  }
  </code></pre>