iOS Developer Library

Developer

MKDirectionsResponse Class Reference

Options
Deployment Target:

On This Page
Language:

MKDirectionsResponse

The MKDirectionsResponse class provides a container for route information returned by the Apple servers. You do not create instances of this class directly. Instead, you initiate a request for directions between two points by calling the calculateDirectionsWithCompletionHandler: method of an MKDirections object. You receive an instance of this class as the result.

Inheritance


Conforms To


Import Statement


import MapKit @import MapKit;

Availability


Available in iOS 7.0 and later.
  • source source Property

    The start point of the route. (read-only)

    Declaration

    Swift

    var source: MKMapItem! { get }

    Objective-C

    @property(nonatomic, readonly) MKMapItem *source

    Discussion

    The item in this property may contain additional details that were not included in the original item used to create the MKDirectionsRequest object.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • The end point of the route. (read-only)

    Declaration

    Swift

    var destination: MKMapItem! { get }

    Objective-C

    @property(nonatomic, readonly) MKMapItem *destination

    Discussion

    The item in this property may contain additional details that were not included in the original item used to create the MKDirectionsRequest object.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • routes routes Property

    An array of route objects representing the directions between the start and end points. (read-only)

    Declaration

    Swift

    var routes: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly) NSArray *routes

    Discussion

    The array contains one or more MKRoute objects, each of which represents a possible set of directions for the user to follow. If you did not request alternate routes in the original directions request, this array contains at most one object.

    Each route object contains geometry information that you can use to display that route on your app’s map view. Routes may also contain additional information that is relevant to that particular route, such as the expected travel time and any trip advisory notices.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.