Created
September 3, 2018 04:02
-
-
Save rockarts/fc83c0c338ca738b0dc84c55f772b0e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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