Last active
August 29, 2015 14:25
-
-
Save chenr2/1eb85cf39e8331017a60 to your computer and use it in GitHub Desktop.
Swift: How to suppress callout for user location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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