iOS Developer Library

Developer

MKRouteStep Class Reference

Options
Deployment Target:

On This Page
Language:

MKRouteStep

An MKRouteStep object represents one part of an overall route. Each step in a route corresponds to a single instruction that would need to be followed by the user. For example, a step might involve following a single road until a turn is required.

You do not create instances of this class directly. Instead, you receive route steps as part of an overall MKRoute object when you request directions from the Maps app. For more information about requesting directions, see MKDirections Class Reference.

Inheritance


Conforms To


Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 7.0 and later.
  • polyline polyline Property

    The detailed step geometry. (read-only)

    Declaration

    Swift

    var polyline: MKPolyline! { get }

    Objective-C

    @property(nonatomic, readonly) MKPolyline *polyline

    Discussion

    The polyline object in this property contains the geometry for this step. You can use the polyline object as an overlay in a map view.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • The written instructions for following the path represented by this step. (read-only)

    Declaration

    Swift

    var instructions: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *instructions

    Discussion

    The string in this property is localized according to the user’s language preferences. You can present this string to the user from your app’s interface.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • notice notice Property

    Additional notices that apply to the step. (read-only)

    Declaration

    Swift

    var notice: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *notice

    Discussion

    Notices may include legal information or warning notices that apply to the step. For example, if the step crosses railroad tracks, it might contain a notice that warns the user not to cross the tracks when the lights are flashing.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • distance distance Property

    The step distance in meters. (read-only)

    Declaration

    Swift

    var distance: CLLocationDistance { get }

    Objective-C

    @property(nonatomic, readonly) CLLocationDistance distance

    Discussion

    This property reflects the distance that the user covers while traversing the path of the step. It is not a direct distance between the start and end points of the step.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • The transport type of the step. (read-only)

    Declaration

    Swift

    var transportType: MKDirectionsTransportType { get }

    Objective-C

    @property(nonatomic, readonly) MKDirectionsTransportType transportType

    Discussion

    This property reflects the transport type employed by the step and may differ from the transport type of the overall route.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 7.0 and later.