I am creating an app that tracks a drive, so as you drive it records location and at the end, it shows a map of where you have been. I am using swiftUI's MapKit
to display map data. In the process of displaying the information, I ran into a problem.
I plan to use MapKit polyline (MKPolyline
) to show the location points but to initialize an MKPolyline
, you must first have an unsafe pointer of either MKMapPoint
s or CLLocationCoordinate2D
s.
init(points: UnsafePointer<MKMapPoint>, count: Int)
init(coordinates: UnsafePointer<CLLocationCoordinate2D>, count: Int)
I have an array of coordinates but need an unsafe pointer instead. How do I go about converting them?