I am using a mapkit
element and want to see the preview. But, the preview option provided by Xcode is showing wrong color for map annotations.
For example, If I set annotation color as yellow, In preview I'm getting blue color.
Sample code:
Map(coordinateRegion: $region, annotationItems: locations, annotationContent: { item in
// a. Old style, always static
MapPin(coordinate: item.location, tint: .accentColor)
})
Note my accent color is: yellow.
Is there any solution to solve this preview bug?
Well. I have found that there is no problem in the code.
It can be a bug of XCode 13.2.1's preview system. Because I have got the correct output using simulator without changing anything in the code. So, nothing to worry at all if you face this kind of issue sometimes.
Still, if anyone have anything to share on top my answer, you are welcome.