Skip to content

Instantly share code, notes, and snippets.

@rockarts
Created September 3, 2018 04:02
Show Gist options
  • Select an option

  • Save rockarts/fc83c0c338ca738b0dc84c55f772b0e6 to your computer and use it in GitHub Desktop.

Select an option

Save rockarts/fc83c0c338ca738b0dc84c55f772b0e6 to your computer and use it in GitHub Desktop.
// Begin navigation when navigation button is tapped
@objc func startNavigation(sender: UIButton) {
let options = NavigationRouteOptions(coordinates: points)
options.profileIdentifier = .automobile
Directions.shared.calculate(options) { (waypoints, routes, error) in
guard let route = routes?.first, error == nil else {
print(error!.localizedDescription)
return
}
let navigationController = NavigationViewController(for: route)
self.present(navigationController, animated: true, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment