How to change bubble color for user location in MapKit?

The map window displays the user's location with a default blue bubble animation. How can I change the default blue to a different color?

+3


source to share


2 answers


You can change tintColor

mapView

to:

mapView.tintColor = UIColor.greenColor()

      



Put this in viewDidLoad()

ViewController

where your embedded mapView

.

+10


source


In swift 3 try with a color literal



mapView.tintColor = #colorLiteral(red: 0.9607843137, green: 0.5764705882, blue: 0.003921568627, alpha: 1)

      

0


source







All Articles