Hello,
Pour Apple Maps, tu peux regarder ce code que j’utilise dans une de mes applications
let placemark = MKPlacemark(coordinate: self.location!, addressDictionary: nil)
let mapItem = MKMapItem(placemark: placemark)
mapItem.name = name
(ça c’est si tu veux nommer le pin qui viendra se placer sur la carte)
mapItem.openInMaps(launchOptions: [MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeWalking])
Et pour Google Maps :
UIApplication.shared.open(URL(string: "comgooglemaps://?saddr=&daddr=\(latitude),\(longitude)&directionsmode=walking")!, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]), completionHandler: nil )
J’utilise le temps et trajet de marche donc à toi d’adapter en conséquence