Class

MKDirections

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

Declaration

@interface MKDirections : NSObject

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 MKDirectionsRequest 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 you should make requests only when you plan to present the corresponding route information to the user. Apps may receive a MKErrorLoadingThrottled error if too many requests have been made from the current device in too short a time period.

Topics

Creating a Directions Object

- initWithRequest:

Initializes and returns a directions object using the specified request.

MKDirectionsRequest

The start and end points of a route, along with the planned mode of transportation.

Getting the Directions

- calculateDirectionsWithCompletionHandler:

Begins calculating the requested route information asynchronously.

MKDirectionsHandler

The block to use for processing the requested route information.

MKDirectionsResponse

The route information returned by Apple servers in response to one of your requests for directions.

Getting the ETA

- calculateETAWithCompletionHandler:

Begins calculating the requested travel-time information asynchronously.

MKETAHandler

The block to use for processing travel-time information.

MKETAResponse

The travel-time information returned by Apple servers.

Managing the Request

- cancel

Cancels a pending request.

calculating

A Boolean value indicating whether a request is currently in process.

Relationships

Inherits From

See Also

Directions

MKDirectionsRequest

The start and end points of a route, along with the planned mode of transportation.

MKDirectionsResponse

The route information returned by Apple servers in response to one of your requests for directions.

MKETAResponse

The travel-time information returned by Apple servers.

MKRoute

A single route between a requested start and end point.

MKRouteStep

One portion of an overall route.