Class

MKDirections

An MKDirections object provides you with route-based directions data from Apple servers. You can use instances of this class to get travel-time information or driving or walking directions based on the data in an MKDirectionsRequest object that you provide. The directions object passes your request to the Apple servers and returns the requested information to a block that you provide.

Overview

Each directions 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 loadingThrottled error if too many requests have been made from the current device in too short a time period.

Symbols

Initializing a Directions Object

init(request: MKDirectionsRequest)

Initializes and returns a directions object using the specified request.

Getting the Directions

func calculate(completionHandler: MKDirectionsHandler)

Begins calculating the requested route information asynchronously.

func calculateETA(completionHandler: MKETAHandler)

Begins calculating the requested travel-time information asynchronously.

func cancel()

Cancels a pending request.

var isCalculating: Bool

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

Constants

MKDirectionsHandler

The block to use for processing the requested route information.

MKETAHandler

The block to use for processing travel-time information.

Relationships

Inherits From

Conforms To