Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
- if (annotation is MKUserLocation){
- return nil
- }
- else{
- let reuseId = "pin"
- var pinView = mapView.dequeueReusableAnnotationView(withIdentifier: reuseId) as? MKPinAnnotationView
- if pinView == nil {
- pinView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
- pinView!.canShowCallout = false
- pinView!.pinTintColor = .red
- pinView!.animatesDrop = true
- pinView!.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
- }
- else {
- pinView!.annotation = annotation
- }
- return pinView
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement