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.