Contents

MKDirections

A utility object that computes directions and travel-time information based on the route information you provide.

Declaration

class MKDirections

Mentioned in

Overview

You use an MKDirections object to ask the Apple servers to provide walking or driving directions for a route, which you specify using an MKDirections.Request object. After making a request, MapKit delivers the results asynchronously to the completion handler that you provide. You can also get the estimated travel time for the route.

Each MKDirections object handles a single request for directions, although you can cancel and restart that request as needed. You can create multiple instances of this class and process different route requests at the same time, but make requests only when you plan to present the corresponding route information to the user. Apps may receive an MKError.Code.loadingThrottled error if the device makes too many requests in too short a time period.

Topics

Creating a directions object

Getting the directions

Getting the ETA

Managing the request

See Also

Directions