TomTomNavigation
public protocol TomTomNavigation : AnyObject
The TomTomNavigation protocol defines the functionality of the navigation.
Important
The current implementation of this API isn’t thread-safe and it’s recommended to make API calls always on the same thread.
Important
This is a Public Preview API. It may be changed or removed at any time.
-
Provides access to current registered engines and allows updating them.
Declaration
Swift
var navigationEngineRegistry: NavigationEngineRegistry { get set } -
The
VehicleProviderused by theTomTomNavigationfor providing vehicle updates to the navigation.Declaration
Swift
var vehicleProvider: VehicleProvider { get } -
Provides a
CLLocationfor map matching.Declaration
Swift
var mapMatchedLocationProvider: LocationProvider { get } -
Provides a
CLLocationfor raw GPS position.Declaration
Swift
var locationProvider: LocationProvider { get set } -
Controls how the route deviations are handled.
When set to
TomTomSDKNavigationEngines/DeviationReplanningMode/automaticthe navigation replans the route automatically. When set toTomTomSDKNavigationEngines/DeviationReplanningMode/nonethe navigation will not replan the route.The default value is
TomTomSDKNavigationEngines/DeviationReplanningMode/automatic.Declaration
Swift
var deviationReplanningMode: DeviationReplanningMode { get set } -
The unit system to be used within
TomTomNavigation.Once set, it is propagated to other components (e.g.
GuidanceEngine) and used for the generation of guidance announcements.If the
UnitSystemTypeinstance is dynamic thenunitSystemis resolved based on the country attribute of the current location:- for “USA” and “PRI” it will resolve to
SpecificUnitSystem/imperialFeet. - for “GBR” it will resolve to
SpecificUnitSystem/imperialYards. - for other countries it will resolve to
SpecificUnitSystem/metric.
The default value is
UnitSystemType.default.Declaration
Swift
var unitSystem: UnitSystemType { get set } - for “USA” and “PRI” it will resolve to
-
The preferred language to be used within
TomTomNavigationin guidance instructions and announcement language.The initial value is
Locale.current. If the initial language is not supported,en-USwill be used instead. Supported languages can be acquired fromGuidanceEngine.availableLanguages.Setting the preferred language updates the route. You can check the updated route language using
language. If the specified language is not supported,en-USwill be used instead.To observe language changes, register:
Declaration
Swift
var preferredLanguage: Locale { get set } -
The current language used within
TomTomNavigationin guidance instructions and announcement language. The initial value isLocale.current. To changelanguage, seepreferredLanguage.Declaration
Swift
var language: Locale { get } -
A publishable variable that can be used to receive the same events that the delegate presents
Declaration
Swift
var eventPublisher: AnyPublisher<NavigationEvent, Never> { get } -
Starts navigation with the default routing.
Declaration
Swift
func start() -
Starts navigation with a navigation plan.
Declaration
Swift
func start(navigationOptions: NavigationOptions)Parameters
navigationOptionsNavigationOptionsto be used during the navigation session. -
Updates the route plan during ongoing navigation.
Declaration
Swift
func update(navigationOptions: NavigationOptions)Parameters
navigationOptionsNavigationOptionsto be used during the navigation session. -
Selects the
Routewith providedrouteIDas active. The navigation will switch to navigate along the desired route and thedidChangeActiveRoute(route:)will be triggered. If theRoutecorresponding to the givenrouteIdis not available, changing will not occur.Declaration
Swift
func selectActiveRoute(routeId: UUID)Parameters
routeIdUUIDid of route that should be selected. -
Marks a departure from the given waypoint independently from
ArrivalDetectionEngine/hasArrivedAtWaypoint.The specified
waypointis marked as having been departed from andNavigationWaypointArrivalObserverare notified about this viaNavigationDestinationArrivalObserver/didArriveAtWaypoint(waypoint:on:). Notification viaNavigationDestinationArrivalObserver/didArriveAtWaypoint(waypoint:on:)completes arrival detection for that particularwaypoint. Navigation switches to arrival detection for the nextwaypoint, if one is present.Prerequisites for this action:
- A
didArriveAtWaypoint(waypoint:on:)notification was previously issued for thiswaypoint. No
didDepartFromWaypoint(waypoint:on:)notification was previously issued for thiswaypoint.
Throws
nextWaypointErrorif calling requirements are not met.Declaration
Swift
func departFromWaypoint(waypoint: RouteStop) throwsParameters
waypointThe waypoint to depart from.
- A
-
Stops the current navigation.
Declaration
Swift
func stop() -
Adds a
NavigationObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addNavigationObserver(_ observer: NavigationObserver)Parameters
observerA class that can handle all navigation events except for error events.
-
Removes the
NavigationObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeNavigationObserver(_ observer: NavigationObserver)Parameters
observerA class that can handle all navigation events except for error events.
-
Adds a
NavigationStartObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addStartObserver(_ observer: NavigationStartObserver)Parameters
observerA class that can handle navigation start events.
-
Removes the
NavigationStartObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeStartObserver(_ observer: NavigationStartObserver)Parameters
observerA class that can handle navigation start events.
-
Adds a
NavigationMapMatchingObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addMapMatchingObserver(_ observer: NavigationMapMatchingObserver)Parameters
observerA class that can handle navigation map matching events.
-
Removes the
NavigationMapMatchingObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeMapMatchingObserver(_ observer: NavigationMapMatchingObserver)Parameters
observerA class that can handle navigation map matching events.
-
Adds a
NavigationProgressObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addProgressObserver(_ observer: NavigationProgressObserver)Parameters
observerA class that can handle navigation start events.
-
Removes the
NavigationProgressObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeProgressObserver(_ observer: NavigationProgressObserver)Parameters
observerA class that can handle navigation progress events.
-
Adds a
NavigationRouteAddObservertoNavigation. The call is expected on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func addRouteAddObserver(_ observer: NavigationRouteAddObserver)Parameters
observerA class that can handle navigation route added events.
-
Removes the
NavigationRouteAddObserverfromNavigation. The call is expected on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func removeRouteAddObserver(_ observer: NavigationRouteAddObserver)Parameters
observerA class that can handle navigation route added events.
-
Adds a
NavigationRouteRemoveObservertoNavigation. The call is expected on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func addRouteRemoveObserver(_ observer: NavigationRouteRemoveObserver)Parameters
observerA class that can handle navigation route removed events.
-
Removes the
NavigationRouteRemoveObserverfromNavigation. The call is expected on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func removeRouteRemoveObserver(_ observer: NavigationRouteRemoveObserver)Parameters
observerA class that can handle navigation route removed events.
-
Adds a
NavigationRouteUpdateObservertoTomTomNavigation. The call is expected on the main queue. The system keeps a weak reference to the observer.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func addRouteUpdateObserver(_ observer: NavigationRouteUpdateObserver)Parameters
observerA class that can handle navigation route updated events.
-
Removes the
NavigationRouteUpdateObserverfromTomTomNavigation. There is no need to unregister the observer. If the observer is not removed, the system will clean up when the next event is posted. The call is expected on the main queue. Do not call this method from the deinitializer of the observer, unless you are certain that the observer will be destroyed on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func removeRouteUpdateObserver(_ observer: NavigationRouteUpdateObserver)Parameters
observerA class that can handle navigation route updated events.
-
Registers a
GuidanceUpdateObserverthat informs about newTomTomSDKNavigationEngines.Guidanceinstances. This is triggered whenever there is a change in location and theTomTomSDKNavigationEngines.GuidanceEnginesuccessfully generates a newTomTomSDKNavigationEngines.Guidance.Precondition
The call is expected on the main queue.Declaration
Swift
func addGuidanceUpdateObserver(_ observer: GuidanceUpdateObserver)Parameters
observerThe
GuidanceUpdateObserverto be registered. -
Unregisters a previously registered
GuidanceUpdateObserver. This method allows you to stop receiving updates about guidance changes.Precondition
The call is expected on the main queue.Declaration
Swift
func removeGuidanceUpdateObserver(_ observer: GuidanceUpdateObserver)Parameters
observerThe
GuidanceUpdateObserverto be unregistered. -
Registers a
LaneGuidanceUpdateObserverto observe and handle newTomTomSDKNavigationEngines.LaneGuidanceinstances. This is triggered whenever there is a change in location and theTomTomSDKNavigationEngines.GuidanceEnginesuccessfully generates a new lane guidance.Precondition
The call is expected on the main queue.Declaration
Swift
func addLaneGuidanceUpdateObserver(_ observer: LaneGuidanceUpdateObserver)Parameters
observerThe
LaneGuidanceUpdateObserverto be registered. -
Unregisters a previously registered
LaneGuidanceUpdateObserver. This method allows you to stop receiving updates about lane guidance changes.Precondition
The call is expected on the main queue.Declaration
Swift
func removeLaneGuidanceUpdateObserver(_ observer: LaneGuidanceUpdateObserver)Parameters
observerThe
LaneGuidanceUpdateObserverto be unregistered. -
Adds a
NavigationActiveRouteChangeObservertoNavigation. The call is expected on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func addActiveRouteChangeObserver(_ observer: NavigationActiveRouteChangeObserver)Parameters
observerA class that can handle navigation active route changed events.
-
Removes the
NavigationActiveRouteChangeObserverfromNavigation. The call is expected on the main queue.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func removeActiveRouteChangeObserver(_ observer: NavigationActiveRouteChangeObserver)Parameters
observerA class that can handle navigation active route changed events.
-
Adds a
NavigationGuidanceObservertoNavigation. The call is expected on the main queue.Declaration
Swift
@available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomNavigation.addGuidanceUpdateObserver(_:﹚ and TomTomNavigation.addLaneGuidanceUpdateObserver(_:﹚ instead.") func addGuidanceObserver(_ observer: NavigationGuidanceObserver)Parameters
observerA class that can handle navigation guidance events.
-
Removes the
NavigationGuidanceObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
@available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomNavigation.removeGuidanceUpdateObserver(_:﹚ and TomTomNavigation.removeLaneGuidanceUpdateObserver(_:﹚ instead.") func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)Parameters
observerA class that can handle navigation guidance events.
-
Adds a
NavigationLocationContextObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addLocationContextObserver(_ observer: NavigationLocationContextObserver)Parameters
observerA class that can handle navigation location context events.
-
Removes the
NavigationLocationContextObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)Parameters
observerA class that can handle navigation location context events.
-
Adds a
NavigationDestinationArrivalObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)Parameters
observerA class that can handle navigation destination arrival events.
-
Removes the
NavigationDestinationArrivalObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)Parameters
observerA class that can handle navigation destination arrival events.
-
Adds a
NavigationWaypointArrivalObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)Parameters
observerA class that can handle navigation waypoint arrival events.
-
Removes the
NavigationWaypointArrivalObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)Parameters
observerA class that can handle navigation waypoint arrival events.
-
Adds a
NavigationHorizonObservertoTomTomNavigation. The call is expected on the main queue.Throws
HorizonError.observerAlreadyRegisteredif thisNavigationHorizonObserverobject is already registered for horizon updates.HorizonError.optionsAlreadyRegisteredif theseHorizonOptionsare already being observed.Declaration
Swift
func addHorizonObserver(_ observer: NavigationHorizonObserver, options: HorizonOptions) throwsParameters
observerA class that can handle navigation horizon events. To register a new observer with the same options, the previous one must be removed first. To register different options with the same observer, the previous one must be removed first.
optionsThe options that define the extent of the paths on the horizon and which map attributes to collect.
-
Removes the
NavigationHorizonObserverfromTomTomNavigation. This method should be called on the deinitialization of the observer. The call is expected on the main queue.Declaration
Swift
func removeHorizonObserver(_ observer: NavigationHorizonObserver) throwsParameters
observerA class that can handle navigation trip events.
-
Adds a
TomTomSDKNavigation/NavigationRouteTrackingStateUpdateObservertoTomTomNavigation. The call is expected on the main queue. The system keeps a weak reference to the observer.Declaration
Swift
func addRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)Parameters
observerA class that can handle navigation follow the route events.
-
Removes the
TomTomSDKNavigation/NavigationRouteTrackingStateUpdateObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)Parameters
observerA class that can handle navigation follow the route events.
-
Adds a
NavigationLanguageChangeObservertoTomTomNavigation. The call is expected on the main queue. The system keeps a weak reference to the observer.Declaration
Swift
func addLanguageChangeObserver(_ observer: NavigationLanguageChangeObserver)Parameters
observerA class that can handle navigation language change events.
-
Removes the
NavigationLanguageChangeObserverfromTomTomNavigation. There is no need to unregister the observer. If the observer is not removed, the system will clean up when the next event is posted. The call is expected on the main queue. Do not call this method from the deinitializer of the observer, unless you are certain that the observer will be destroyed on the main queue.Declaration
Swift
func removeLanguageChangeObserver(_ observer: NavigationLanguageChangeObserver)Parameters
observerA class that can report on changes to the navigation language.
-
The current
BetterProposalAcceptanceMode.Declaration
Swift
var betterProposalAcceptanceMode: BetterProposalAcceptanceMode { get set } -
Adds a
NavigationErrorObservertoTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func addErrorObserver(_ observer: NavigationErrorObserver)Parameters
observerA class that can handle navigation error events.
-
Removes the
NavigationErrorObserverfromTomTomNavigation. The call is expected on the main queue.Declaration
Swift
func removeErrorObserver(_ observer: NavigationErrorObserver)Parameters
observerA class that can handle navigation error events.
TomTom SDK for iOS (0.40.0)
TomTomNavigation