Protocols
The following protocols are available globally.
-
Engine that instantiates the update of the data store used for navigation.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol DataStoreMaintenanceEngine : ManageableEngine
-
See more
Important
This is a Public Preview API. It may be changed or removed at any time.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
-
The
TomTomNavigationprotocol defines the functionality of the navigation.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol TomTomNavigation : AnyObject
-
Provides access to current registered engines and allows updating them.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationEngineRegistry : AnyObject
-
The NavigationEngines protocol defines all engines that can be used by the TomTomSDKNavigation module.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationEngines : MainNavigationEngines, RouteNavigationEnginesProvider
-
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 usingremoveGuidanceUpdateObserver(_:).See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol GuidanceUpdateObserver : Observer
-
Informs the caller about changes in lane guidance. This interface provides an observer for when lane guidance starts and ends.
The
LaneGuidanceUpdateObserverinterface 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 usingremoveLaneGuidanceUpdateObserver(_:).See moreNote
To ensure these methods are called, theRoutepassed toTomTomNavigationmust contain validLaneSections. This code is used within the context of a navigation system where lane guidance is crucial for the user experience and journey accuracy.Declaration
Swift
public protocol LaneGuidanceUpdateObserver : Observer
-
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
NavigationDestinationArrivalObserverprotocol: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
See moreremoveDestinationArrivalObserver(_:).Declaration
Swift
public protocol NavigationDestinationArrivalObserver : Observer
-
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
-
An observer that receives navigation guidance events.
See moreDeclaration
Swift
public protocol NavigationGuidanceObserver : Observer
-
An observer that receives navigation horizon events.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationHorizonObserver : Observer
-
An observer that receives
TomTomNavigation.languagechange events.To register a
See moreNavigationLanguageChangeObserver, useaddLanguageChangeObserver(_:). To stop receiving these events, unregister the observer usingremoveLanguageChangeObserver(_:).Declaration
Swift
public protocol NavigationLanguageChangeObserver : Observer
-
An observer that receives navigation guidance events.
See moreDeclaration
Swift
public protocol NavigationLocationContextObserver : Observer
-
An observer that receives navigation map matching events.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationMapMatchingObserver : Observer
-
An observer that receives navigation progress events.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationProgressObserver : Observer
-
An observer that receives navigation route events.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationRouteObserver : Observer
-
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 usingNavigation.removeRouteTrackingStateUpdateObserver(_ observer:):See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationRouteTrackingStateUpdateObserver : Observer
-
An observer that receives navigation start events.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol NavigationStartObserver : Observer
-
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 theTomTomSDKNavigationEngines/ArrivalDetectionEngine:didArriveAtWaypoint(waypoint:on:)is received when theTomTomSDKNavigationEngines/ArrivalDetectionEnginedetects an arrival at a waypoint.didDepartFromWaypoint(waypoint:on:)is received when theTomTomSDKNavigationEngines/ArrivalDetectionEnginedetects a departure from a waypoint.
To be notified about the waypoint arrival events while navigating, first implement the
NavigationWaypointArrivalObserverprotocol: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
See moreremoveWaypointArrivalObserver(_:).Declaration
Swift
public protocol NavigationWaypointArrivalObserver : Observer -
Specifies how to handle requests which failed during replanning of a
Route.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol ReplanningRetryPolicy
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol SimpleEngineCommonCalculator
Protocols Reference