Skip to content

Instantly share code, notes, and snippets.

@chenr2
Last active August 29, 2015 14:25
Show Gist options
  • Save chenr2/1eb85cf39e8331017a60 to your computer and use it in GitHub Desktop.
Save chenr2/1eb85cf39e8331017a60 to your computer and use it in GitHub Desktop.
Swift: How to suppress callout for user location
func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView!{
// user location
if annotation is MKUserLocation {
(annotation as! MKUserLocation).title = ""
// use blue pulsy instead of pin
return nil
}
// other pins
return mapView.dequeueReusableAnnotationViewWithIdentifier("pin") as? MKPinAnnotationView
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment