RouteController

open class RouteController : NSObject
extension RouteController: HistoryRecording
extension RouteController: Router

A RouteController tracks the user’s progress along a route, posting notifications as the user reaches significant points along the route. On every location update, the route controller evaluates the user’s location, determining whether the user remains on the route. If not, the route controller calculates a new route.

RouteController is responsible for the core navigation logic whereas NavigationViewController is responsible for displaying a default drop-in navigation UI.

Important

Creating an instance of this type will start an Active Guidance session. The trip session is stopped when the instance is deallocated. From more info read the Pricing Guide.

Precondition

There should be only one RouteController alive to any given time.
  • Declaration

    Swift

    public var reroutesProactively: Bool
  • Declaration

    Swift

    public var initialManeuverAvoidanceRadius: TimeInterval { get set }
  • Controls whether the route controller automatically updates ETA and traffic congestion data.

    When enabled, the route controller periodically refreshes route information at intervals defined by RouteControllerProactiveReroutingInterval. By default, route refreshing is enabled only for routes using .automobileAvoidingTraffic or another driving-traffic profile. If reroutesProactively is also enabled, the route controller runs the rerouting check after the route refresh completes.

    Important

    Route refresh is currently supported only for driving-traffic profiles. Enabling this property for other profiles (such as walking, cycling, or standard driving) may result in server errors or undefined behavior.

    Declaration

    Swift

    public var refreshesRoute: Bool { get set }
  • Declaration

    Swift

    public private(set) var continuousAlternatives: [AlternativeRoute] { get }
  • Enables automatic switching to online version of the current route when possible.

    Indicates if RouteController will attempt to detect if current route was build offline and if there is an online route with the same path is available to automatically switch to it. Using online route is beneficial due to available live data like traffic congestion, incidents, etc. Check is not performed instantly and it is not guaranteed to receive an online version at any given period of time.

    Enabled by default.

    Declaration

    Swift

    public var prefersOnlineRoute: Bool