From the course: Advanced iOS App Development: MapKit & Core Location
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Display step-by-step directions - iOS Tutorial
From the course: Advanced iOS App Development: MapKit & Core Location
Display step-by-step directions
- [Instructor] Remember I said there were two properties that you could use for directions. You've seen the poly line. Let's look at the other one, the steps. Go ahead and shut down the app while we're at it. And steps is an array of MK route step, which contains everything you need to know about one step in the directions, including a very useful poly line for the step. The instructions themselves, in natural language, and the distance. We'll place these instructions in the history text of a destination annotation. Head over to the findDirections method. We'll need a coordinate of the destination. After the loop for route description, which I'm going to change to a var while I'm at it, 'cause I'm going to use this in a second. Add let destination equal... response.destination.placemark.coordinate. I'm going to use the first route as my route and copy and paste the route description, adding some new lines at the end of it and changing the let to var. So I'm going to take this line I…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Request directions6m 27s
-
(Locked)
Display graphic directions7m 38s
-
(Locked)
Display step-by-step directions6m 27s
-
(Locked)
Challenge 7: The chosen path27s
-
(Locked)
Solution 7: The chosen path1m 2s
-
(Locked)
Launching the maps app6m 34s
-
(Locked)
Final challenge: Transit ETA annotation45s
-
(Locked)
Final solution: Transit ETA annotation6m 14s
-
(Locked)
-