1

I'm using this code to get directions to some location by native iOS maps

let item = MKMapItem(placemark: MKPlacemark(coordinate: self.customCoordinate, addressDictionary: nil))
if !MKMapItem.openMaps(with: [item], launchOptions: [ MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeDriving]) {
    print("error opening maps")
}

Is it possible to check if native Apple Maps app is available (it is possible to "remove" it from desktop in iOS 10+)? I would want to hide "Get directions" button instead of letting user click on it and get error.

Stas Ivanov
  • 917
  • 1
  • 10
  • 22
  • Not possible to check? – Stas Ivanov May 26 '17 at 11:19
  • There is already answered in another thread https://stackoverflow.com/questions/39603120/how-to-check-if-apple-maps-is-installed . You can check if apple map is installed or not using UIApplication.shared.canOpenURL(URL(string: "maps://")!) . – Hendy Evan Dec 04 '18 at 06:48

0 Answers0