Closed nashirj closed 3 years ago
Here is code for opening the trip in maps (which should happen when you click on the map on the details page)
let sourcePlacemark = MKPlacemark(coordinate: CLLocationCoordinate2D(latitude: sourceLat, longitude: sourceLong))
let source = MKMapItem(placemark: sourcePlacemark)
source.name = "Source"
let destPlacemark = MKPlacemark(coordinate: CLLocationCoordinate2D(latitude: destLat, longitude: destLong))
let destination = MKMapItem(placemark: destPlacemark)
destination.name = "Destination"
MKMapItem.openMaps(with: [source, destination], launchOptions: [MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving])
https://guides.codepath.com/ios/Maps