Protocols

The following protocols are available globally.

  • Engine that instantiates the update of the data store used for navigation.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol DataStoreMaintenanceEngine : ManageableEngine

MainNavigationEngines

  • Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol MainNavigationEngines
  • Provides access to Dynamic Routing

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public protocol DynamicRoutingProvider
  • Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public protocol RouteNavigationEnginesProvider

TomTomNavigation

  • The TomTomNavigation protocol defines the functionality of the navigation.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol TomTomNavigation : AnyObject

NavigationEngineRegistry

  • Provides access to current registered engines and allows updating them.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationEngineRegistry : AnyObject

NavigationEngines

GuidanceUpdateObserver

  • Informs the caller about announcements and instructions update events.

    The method TomTomSDKNavigationEngines.GuidanceEngine.generateGuidance(navigationSnapshot:) generates the guidance with instructions and distance. Based on the guidance result, the methods of the observers are called.

    The protocol provides the interface for handling several events like changes in instructions, generation of announcements, and changes in distance to the next instruction.

    To observe the guidance changes, first implement this interface to create an observer, for example:

    class CustomGuidanceUpdateObserver: GuidanceUpdateObserver {
    
        func didChangeInstructions(instructions: [GuidanceInstruction]) {
            // Add code here that handles the changes of instructions.
        }
    
        func didGenerateAnnouncement(announcement: GuidanceAnnouncement, shouldPlay: Bool) {
            // Add code here that handles a new generate announcement.
        }
    
        func didChangeDistanceToNextInstruction(
            distance: Measurement<UnitLength>,
            instructions: [GuidanceInstruction],
            currentPhase: InstructionPhase
        ) {
            // Add code here that handles a change of distance to new instruction.
        }
    }
    

    Then add the observer using addGuidanceUpdateObserver(_:). To stop observation of the guidance changes, remove the observer using removeGuidanceUpdateObserver(_:).

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol GuidanceUpdateObserver : Observer

LaneGuidanceUpdateObserver

  • Informs the caller about changes in lane guidance. This interface provides an observer for when lane guidance starts and ends.

    The LaneGuidanceUpdateObserver interface provides the methods that are called when lane guidance shall appear and disappear, respectively. These methods facilitate efficient and dynamic update of lane guidance information during a journey.

    To observe the lane guidance changes, first implement this interface to create an observer, for example:

    class CustomLaneGuidanceObserver: LaneGuidanceUpdateObserver {
        func didStartLaneGuidance(laneGuidance: LaneGuidance) {
            // Add code here that handles the lane guidance starting
        }
    
        func didEndLaneGuidance(laneGuidance: LaneGuidance) {
            // Add code here that handles the lane guidance ending
        }
    }
    

    Then add the observer using addLaneGuidanceUpdateObserver(_:). To stop observation of the lane guidance changes, remove the observer using removeLaneGuidanceUpdateObserver(_:).

    Note

    To ensure these methods are called, the Route passed to TomTomNavigation must contain valid LaneSections. This code is used within the context of a navigation system where lane guidance is crucial for the user experience and journey accuracy.
    See more

    Declaration

    Swift

    public protocol LaneGuidanceUpdateObserver : Observer

NavigationDestinationArrivalObserver

  • An observer that receives navigation events of arrival at destination.

    Destination arrival is detected by the TomTomSDKNavigationEngines/ArrivalDetectionEngine. On arrival detection, navigation continues in turn-by-turn mode until it’s stopped or switched into free-driving mode.

    To be notified about the destination arrival event while navigating, first implement the NavigationDestinationArrivalObserver protocol:

    class NavigationDestinationArrivalObserverImpl: NavigationDestinationArrivalObserver {
        func didArriveAtDestination(route: TomTomSDKRoute.Route) {
            // Add code here that handles arrival at a destination.
        }
    }
    

    Then register this observer using addDestinationArrivalObserver(_:).

    To stop receiving the destination arrival event, unregister the observer using removeDestinationArrivalObserver(_:).

    See more

    Declaration

    Swift

    public protocol NavigationDestinationArrivalObserver : Observer

NavigationErrorObserver

  • An observer that receives navigation error events.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public protocol NavigationErrorObserver : Observer

NavigationGuidanceObserver

NavigationHorizonObserver

  • An observer that receives navigation horizon events.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationHorizonObserver : Observer

NavigationLanguageChangeObserver

NavigationLocationContextObserver

NavigationMapMatchingObserver

  • An observer that receives navigation map matching events.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationMapMatchingObserver : Observer

NavigationProgressObserver

  • An observer that receives navigation progress events.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationProgressObserver : Observer

NavigationRouteObserver

  • An observer that receives navigation route events.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationRouteObserver : Observer

NavigationRouteTrackingStateUpdateObserver

  • An observer that receives route tracking state updates.

    The information about the route state is represented by RouteTrackingState. When the driver deviates or returns to the active route, the navigation engine sends route-tracking state updates to the observer.

    To start receiving route tracking state updates, become an observer using Navigation.addRouteTrackingStateUpdateObserver(_ observer:): To stop receiving route tracking state updates, remove the previously added observer using Navigation.removeRouteTrackingStateUpdateObserver(_ observer:):

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationRouteTrackingStateUpdateObserver : Observer

NavigationStartObserver

  • An observer that receives navigation start events.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol NavigationStartObserver : Observer

NavigationWaypointArrivalObserver

  • An observer that receives navigation events related with visiting waypoints.

    The waypoint arrival state changes are detected by the TomTomSDKNavigationEngines/ArrivalDetectionEngine. Different observer methods are called depending on what state has been detected by the TomTomSDKNavigationEngines/ArrivalDetectionEngine:

    To be notified about the waypoint arrival events while navigating, first implement the NavigationWaypointArrivalObserver protocol:

    class NavigationWaypointArrivalObserverImpl: NavigationWaypointArrivalObserver {
        func didArriveAtWaypoint(waypoint: RouteStop, on route: Route) {
            // Add code here that handles an arrival at a waypoint.
        }
    
        func didDepartFromWaypoint(waypoint: RouteStop, on route: Route) {
            // Add code here that handles a departure from a waypoint.
        }
    }
    

    Then register this observer using addWaypointArrivalObserver(_:).

    To stop receiving these events, unregister the observer using removeWaypointArrivalObserver(_:).

    See more

    Declaration

    Swift

    public protocol NavigationWaypointArrivalObserver : Observer
  • Specifies how to handle requests which failed during replanning of a Route.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol ReplanningRetryPolicy

SimpleEngineCommonCalculator

  • Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public protocol SimpleEngineCommonCalculator