Instruction

struct Instruction

An instruction for a user to get from one Coordinate to another. It will have a Coordinate it happens at, an Action (depart, arrive, turn, take vortex), and optional Locations to perform this at or towards, as well as a String representing the text instructions to display to the user.

The at/towardsLocation properties are to let you mark or highlight key reference locations on the MapView if they will help the user find or keep their bearings.

  • An Action is the type of thing being performed at a Coordinate: Departing, arriving, turning, or entering a Connection

    Declaration

    Swift

    public typealias Action = DirectionsInstructionAction
  • Start out leaving from this Coordinate

    Declaration

    Swift

    public struct Departure : Action
  • End when you get at this Coordinate

    Declaration

    Swift

    public struct Arrival : Action
  • Turn when you get to this node. You can turn left, slight left, straight, slight right, or right.

    It may also include a reference position (at, past, before). For example: Turn left before the fountain

    See more

    Declaration

    Swift

    public struct Turn : Action
  • Use a Connection to go from one Map to another

    See more

    Declaration

    Swift

    public struct TakeConnection : Action
  • Exit a Connection used to go from one Map to another

    See more

    Declaration

    Swift

    public struct ExitConnection : Action
  • The Coordinate this Direction occurs at

    Declaration

    Swift

    public let coordinate: Coordinate
  • The type of thing happening at this Coordinate

    Declaration

    Swift

    public let action: Action
  • A Location to display to the user, indicating whereabouts this Direction should occur (since a Coordinate can just be an arbitrary spot on the floor)

    Declaration

    Swift

    public let atLocation: Location?
  • Text instructions to display to the user

    Declaration

    Swift

    public internal(set) var description: String { get }