iOS Developer Library

Developer

MapKit Framework Reference MKETAResponse Class Reference

Options
Deployment Target:

On This Page
Language:

MKETAResponse

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

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

    Declaration

    Swift

    var source: MKMapItem { get }

    Objective-C

    @property(nonatomic, readonly) MKMapItem *source

    Discussion

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

    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.

    Availability

    Available in iOS 7.0 and later.

  • The expected travel time in seconds. (read-only)

    Declaration

    Swift

    var expectedTravelTime: NSTimeInterval { get }

    Objective-C

    @property(nonatomic, readonly) NSTimeInterval expectedTravelTime

    Discussion

    The expected travel time reflects the time it takes to traverse the route, taking expected traffic into account. The actual amount of time may vary based on changes in traffic and other travel conditions.

    Availability

    Available in iOS 7.0 and later.

  • The expected departure time. (read-only)

    Declaration

    Swift

    var expectedDepartureDate: NSDate { get }

    Objective-C

    @property(nonatomic, readonly) NSDate *expectedDepartureDate

    Discussion

    The value of this property is dependent on whether you specified a departure date or arrival date in your MKDirectionsRequest object. If you specified a departure date, that date is copied to this property. If you specified an arrival date but not a departure date, the departure date is computed by subtracting the expected travel time from your arrival date. If you did not specify an arrival date or departure date, this property is set to the current time.

    Availability

    Available in iOS 9.0 and later.

  • The expected arrival time. (read-only)

    Declaration

    Swift

    var expectedArrivalDate: NSDate { get }

    Objective-C

    @property(nonatomic, readonly) NSDate *expectedArrivalDate

    Discussion

    The value of this property is dependent on whether you specified a departure date or arrival date in your MKDirectionsRequest object. If you specified a departure date, the date in this property is computed by starting at your departure date and adding the expected travel time. If you specified an arrival time but not a departure date, this property is set to your arrival time. If you did not specify an arrival date or departure date, this property is set to the date computed by adding the travel time to the current time.

    Availability

    Available in iOS 9.0 and later.

  • The expected travel distance, in meters. (read-only)

    Declaration

    Swift

    var distance: CLLocationDistance { get }

    Objective-C

    @property(nonatomic, readonly) CLLocationDistance distance

    Discussion

    This property contains the overall distance traversed by the route.

    Availability

    Available in iOS 9.0 and later.

  • The type of conveyance used to determine the travel time. (read-only)

    Declaration

    Swift

    var transportType: MKDirectionsTransportType { get }

    Objective-C

    @property(nonatomic, readonly) MKDirectionsTransportType transportType

    Discussion

    You specify the desired transportation type in your MKDirectionsRequest object. If you specified MKDirectionsTransportTypeAny, this property contains the transportation type used to generate the estimated information.

    Availability

    Available in iOS 9.0 and later.