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.

Request directions

Request directions - iOS Tutorial

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

Start my 1-month free trial

Request directions

- [Narrator] We've found several pizza restaurants, but how do we get to them? You can get directions between two points with the MK direction service. The service checks with Apple servers to get what they believe to be the best route to get to your destination. We'll find directions between the two Chicago and two Beverley Hills restaurants. To get directions you need to make a request. Requests are the MK directions request object. At a minimum you'll need the source point, which I'll call the start point and a destination point. These two points are map items, not coordinates, so they work well with searches. Stop the app. Go to the view controller and head to the directions mark. Here we'll make a new function called find directions. We'll have a start point and just because we like to have it that way I'm going to use coordinates because my app happens to have a lot of coordinates running around. We'll have a destination. And generally these things help a lot if you actually put…

Contents