I redefined one function
func mapView(mapView: MKMapView, didSelectAnnotationView view: MKAnnotationView) { mapView.deselectAnnotation(view.annotation, animated: true) }
I commented on this feature and got the titles and subtitles.
Updated Code
/* func mapView(mapView: MKMapView, didSelectAnnotationView view: MKAnnotationView) { mapView.deselectAnnotation(view.annotation, animated: true) } */ func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { //return nil so map view draws "blue dot" for standard user location return nil } let reuseId = "pin" let pinView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: reuseId) pinView.canShowCallout = true pinView.animatesDrop = true pinView.pinTintColor = UIColor.darkGrayColor() pinView.draggable = true pinView.accessibilityLabel = "hello" let btn = UIButton(type: .DetailDisclosure) pinView.rightCalloutAccessoryView = btn return pinView }
source share