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

Display step-by-step directions - iOS Tutorial

From the course: Advanced iOS App Development: MapKit & Core Location

Start my 1-month free trial

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…

Contents