DefaultTomTomNavigation
@available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.")
public class DefaultTomTomNavigation : TomTomNavigation
The DefaultTomTomNavigation object defines the functionality of the navigation.
Important
DefaultTomTomNavigation isn’t thread-safe and it’s recommended to make API calls always on the same thread.-
init(locationProvider:dataSourceSelectionEngine: dataStoreMaintenanceEngine: mapMatchingEngine: routeProgressEngine: guidanceEngine: routeTrackingEngine: arrivalDetectionEngine: horizonEngine: routeReplanner: routeReplanningEngine: routeProjectionEngine: routeReplanningRetryPolicy: routeDeviationReplanningRetryPolicy: betterProposalAcceptanceMode: deviationReplanningMode: vehicleProvider: usePredictions: ) Creates an instance of
DefaultTomTomNavigation.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init( locationProvider: LocationProvider, dataSourceSelectionEngine: DataSourceSelectionEngine?, dataStoreMaintenanceEngine: DataStoreMaintenanceEngine?, mapMatchingEngine: MapMatchingEngine, routeProgressEngine: RouteProgressEngine, guidanceEngine: GuidanceEngine, routeTrackingEngine: RouteTrackingEngine?, arrivalDetectionEngine: ArrivalDetectionEngine, horizonEngine: HorizonEngine?, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner, routeReplanningEngine: RouteReplanningEngine, routeProjectionEngine: RouteProjectionEngine?, routeReplanningRetryPolicy: ReplanningRetryPolicy, routeDeviationReplanningRetryPolicy: ReplanningRetryPolicy, betterProposalAcceptanceMode: BetterProposalAcceptanceMode, deviationReplanningMode: DeviationReplanningMode, vehicleProvider: VehicleProvider, usePredictions: Bool )Parameters
locationProviderThe
LocationProviderto be used during navigation.dataSourceSelectionEngineThe
DataSourceSelectionEngineto be used during navigation.dataStoreMaintenanceEngineThe
DataStoreMaintenanceEngineto be used during navigation.mapMatchingEngineThe
MapMatchingEngineto be used during navigation.routeProgressEngineThe
RouteProgressEngineto be used during navigation.guidanceEngineThe
GuidanceEngineto be used during navigation.routeTrackingEngineThe
RouteTrackingEngineto be used during navigation.arrivalDetectionEngineThe
ArrivalDetectionEngineto be used during navigation.horizonEngineThe
HorizonEngineto be used during navigation.routeReplannerThe
TomTomSDKRouteReplanner.RouteReplannerto be used during navigation.routeReplanningEngineThe
RouteReplanningEngineto be used during navigation.routeProjectionEngineThe
RouteProjectionEngineto be used during navigation.routeReplanningRetryPolicyThe
ReplanningRetryPolicyto be used during navigation for replanning.routeDeviationReplanningRetryPolicyThe
ReplanningRetryPolicyto be used during navigation for replanning on deviation.betterProposalAcceptanceModeThe
BetterProposalAcceptanceModeto be used during navigation.deviationReplanningModeThe
DeviationReplanningModeto be used during navigation.vehicleProviderThe
VehicleProviderto be used during navigation.usePredictionsUse predictions during navigation.
-
init(locationProvider:dataSourceSelectionEngine: dataStoreMaintenanceEngine: mapMatchingEngine: routeProgressEngine: guidanceEngine: routeTrackingEngine: arrivalDetectionEngine: horizonEngine: routeReplanner: routeReplanningEngine: routeProjectionEngine: routeReplanningRetryPolicy: routeDeviationReplanningRetryPolicy: betterProposalAcceptanceMode: deviationReplanningMode: vehicleProvider: ) Creates an instance of
DefaultTomTomNavigation.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public convenience init( locationProvider: LocationProvider, dataSourceSelectionEngine: DataSourceSelectionEngine?, dataStoreMaintenanceEngine: DataStoreMaintenanceEngine?, mapMatchingEngine: MapMatchingEngine, routeProgressEngine: RouteProgressEngine, guidanceEngine: GuidanceEngine, routeTrackingEngine: RouteTrackingEngine?, arrivalDetectionEngine: ArrivalDetectionEngine, horizonEngine: HorizonEngine?, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner, routeReplanningEngine: RouteReplanningEngine, routeProjectionEngine: RouteProjectionEngine?, routeReplanningRetryPolicy: ReplanningRetryPolicy, routeDeviationReplanningRetryPolicy: ReplanningRetryPolicy, betterProposalAcceptanceMode: BetterProposalAcceptanceMode, deviationReplanningMode: DeviationReplanningMode, vehicleProvider: VehicleProvider )Parameters
locationProviderThe
LocationProviderto be used during navigation.dataSourceSelectionEngineThe
DataSourceSelectionEngineto be used during navigation.dataStoreMaintenanceEngineThe
DataStoreMaintenanceEngineto be used during navigation.mapMatchingEngineThe
MapMatchingEngineto be used during navigation.routeProgressEngineThe
RouteProgressEngineto be used during navigation.guidanceEngineThe
GuidanceEngineto be used during navigation.routeTrackingEngineThe
RouteTrackingEngineto be used during navigation.arrivalDetectionEngineThe
ArrivalDetectionEngineto be used during navigation.horizonEngineThe
HorizonEngineto be used during navigation.routeReplannerThe
TomTomSDKRouteReplanner.RouteReplannerto be used during navigation.routeReplanningEngineThe
RouteReplanningEngineto be used during navigation.routeProjectionEngineThe
RouteProjectionEngineto be used during navigation.routeReplanningRetryPolicyThe
ReplanningRetryPolicyto be used during navigation for replanning.routeDeviationReplanningRetryPolicyThe
ReplanningRetryPolicyto be used during navigation for replanning on deviation.betterProposalAcceptanceModeThe
BetterProposalAcceptanceModeto be used during navigation.deviationReplanningModeThe
DeviationReplanningModeto be used during navigation.vehicleProviderThe
VehicleProviderto be used during navigation.
-
Errors that are thrown when removing/adding horizon observer.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum HorizonError : Error -
Provides access to currently registered engines and allows updating them.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var navigationEngineRegistry: NavigationEngineRegistry -
The
VehicleProviderused by theDefaultTomTomNavigationfor providing vehicle updates to the navigation.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public let vehicleProvider: VehicleProvider -
The current
BetterProposalAcceptanceMode.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var betterProposalAcceptanceMode: TomTomSDKNavigationEngines.BetterProposalAcceptanceMode { 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.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var unitSystem: UnitSystemType { get set } - for “USA” and “PRI” it will resolve to
-
The current language used within
TomTomNavigationin guidance instructions and announcement language. The initial value isLocale.current. To changelanguage, seepreferredLanguage.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var language: Locale { get } -
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:
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var preferredLanguage: Locale { get set } -
Provides a
CLLocationfor map matching.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var mapMatchedLocationProvider: LocationProvider { get } -
Provides a
CLLocationfor raw GPS position.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var locationProvider: LocationProvider { get set } -
A publishable variable that can be used to receive the same events that the delegate presents
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var eventPublisher: AnyPublisher<NavigationEvent, Never> { get } -
The mode used for replanning when a deviation occurs.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var deviationReplanningMode: DeviationReplanningMode { get set } -
Adds a
NavigationObservertoDefaultTomTomNavigation. 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
public func addNavigationObserver(_ observer: NavigationObserver)Parameters
observerA class that can handle all navigation events except for error events.
-
Removes the
NavigationObserverfromDefaultTomTomNavigation. 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
public func removeNavigationObserver(_ observer: NavigationObserver)Parameters
observerA class that can handle all navigation events except for error events.
-
Adds a
NavigationStartObservertoDefaultTomTomNavigation. 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
public func addStartObserver(_ observer: NavigationStartObserver)Parameters
observerA class that can handle navigation start events.
-
Removes the
NavigationStartObserverfromDefaultTomTomNavigation. 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
public func removeStartObserver(_ observer: NavigationStartObserver)Parameters
observerA class that can handle navigation start events.
-
Adds a
NavigationMapMatchingObservertoDefaultTomTomNavigation. 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
public func addMapMatchingObserver(_ observer: NavigationMapMatchingObserver)Parameters
observerA class that can handle navigation map matching events.
-
Removes the
NavigationMapMatchingObserverfromDefaultTomTomNavigation. 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
public func removeMapMatchingObserver(_ observer: NavigationMapMatchingObserver)Parameters
observerA class that can handle navigation map matching events.
-
Adds a
NavigationProgressObservertoDefaultTomTomNavigation. 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
public func addProgressObserver(_ observer: NavigationProgressObserver)Parameters
observerA class that can handle navigation start events.
-
Removes the
NavigationProgressObserverfromDefaultTomTomNavigation. 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
public 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
public 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
public 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
public 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
public func removeRouteRemoveObserver(_ observer: NavigationRouteRemoveObserver)Parameters
observerA class that can handle navigation route removed events.
-
Adds a
NavigationRouteUpdateObservertoDefaultTomTomNavigation. 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
public func addRouteUpdateObserver(_ observer: NavigationRouteUpdateObserver)Parameters
observerA class that can handle navigation route updated events.
-
Removes the
NavigationRouteUpdateObserverfromDefaultTomTomNavigation. 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
public func removeRouteUpdateObserver(_ observer: NavigationRouteUpdateObserver)Parameters
observerA class that can handle navigation route updated events.
-
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
public 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
public func removeActiveRouteChangeObserver(_ observer: NavigationActiveRouteChangeObserver)Parameters
observerA class that can handle navigation active route changed events.
-
Adds a
GuidanceUpdateObservertoTomTomNavigation. 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
public func addGuidanceUpdateObserver(_ observer: GuidanceUpdateObserver)Parameters
observerA class that can handle navigation guidance events.
-
Removes the
GuidanceUpdateObserverfromTomTomNavigation. 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
public func removeGuidanceUpdateObserver(_ observer: GuidanceUpdateObserver)Parameters
observerA class that can handle navigation guidance events.
-
Adds a
LaneGuidanceUpdateObservertoTomTomNavigation. 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
public func addLaneGuidanceUpdateObserver(_ observer: LaneGuidanceUpdateObserver)Parameters
observerA class that can handle navigation guidance events.
-
Removes a
LaneGuidanceUpdateObserverfromTomTomNavigation. 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
public func removeLaneGuidanceUpdateObserver(_ observer: LaneGuidanceUpdateObserver)Parameters
observerA class that can handle navigation guidance events.
-
Adds a
NavigationGuidanceObservertoNavigation. 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
public func addGuidanceObserver(_ observer: NavigationGuidanceObserver)Parameters
observerA class that can handle navigation guidance events.
-
Removes the
NavigationGuidanceObserverfromDefaultTomTomNavigation. 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
public func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)Parameters
observerA class that can handle navigation guidance events.
-
Adds a
NavigationLocationContextObservertoDefaultTomTomNavigation. 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
public func addLocationContextObserver(_ observer: NavigationLocationContextObserver)Parameters
observerA class that can handle navigation location context events.
-
Removes the
NavigationLocationContextObserverfromDefaultTomTomNavigation. 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
public func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)Parameters
observerA class that can handle navigation location context events.
-
Adds a
NavigationDestinationArrivalObservertoDefaultTomTomNavigation. 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
public func addDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)Parameters
observerA class that can handle navigation arrival events.
-
Removes the
NavigationDestinationArrivalObserverfromDefaultTomTomNavigation. 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
public func removeDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)Parameters
observerA class that can handle navigation arrival events.
-
Adds a
NavigationWaypointArrivalObservertoDefaultTomTomNavigation. 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
public func addWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)Parameters
observerA class that can handle navigation arrival events.
-
Removes the
NavigationWaypointArrivalObserverfromDefaultTomTomNavigation. 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
public func removeWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)Parameters
observerA class that can handle navigation arrival events.
-
Adds a
NavigationHorizonObservertoDefaultTomTomNavigation. The call is expected on the main queue.Throws
HorizonError.observerAlreadyRegisteredif thisNavigationHorizonObserverobject is already registered for horizon updates.HorizonError.optionsAlreadyRegisteredif theseHorizonOptionsare already being observed.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public 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
NavigationHorizonObserverfromDefaultTomTomNavigation. This method should be called on the deinitialization of the observer. 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
public func removeHorizonObserver(_ observer: NavigationHorizonObserver) throwsParameters
observerA class that can handle navigation trip events.
-
Adds a
TomTomSDKNavigation/NavigationRouteTrackingStateUpdateObservertoDefaultTomTomNavigation. The call is expected on the main queue. The system keeps a weak reference to the observer.Declaration
Swift
public func addRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)Parameters
observerA class that can handle navigation follow the route events.
-
Removes the
TomTomSDKNavigation/NavigationRouteTrackingStateUpdateObserverfromDefaultTomTomNavigation. The call is expected on the main queue.Declaration
Swift
public func removeRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)Parameters
observerA class that can handle navigation follow the route events.
-
Adds a
NavigationErrorObservertoDefaultTomTomNavigation. 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
public func addErrorObserver(_ observer: NavigationErrorObserver)Parameters
observerA class that can handle navigation error events.
-
Removes the
NavigationErrorObserverfromDefaultTomTomNavigation. 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
public func removeErrorObserver(_ observer: NavigationErrorObserver)Parameters
observerA class that can handle navigation error events.
-
Adds a
NavigationLanguageChangeObservertoDefaultTomTomNavigation. 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
public func addLanguageChangeObserver(_ observer: NavigationLanguageChangeObserver)Parameters
observerA class that can handle navigation language change events.
-
Removes the
NavigationLanguageChangeObserverfromDefaultTomTomNavigation. 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
public func removeLanguageChangeObserver(_ observer: NavigationLanguageChangeObserver)Parameters
observerA class that can report on changes to the navigation language.
-
Starts navigation with the default routing.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func start() -
Starts navigation with a navigation plan.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func start(navigationOptions: NavigationOptions)Parameters
navigationOptionsNavigationOptionsto be used during the navigation session. -
Updates the route plan during ongoing navigation.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public 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.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public 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
public func departFromWaypoint(waypoint: RouteStop) throwsParameters
waypointThe waypoint to depart from.
- A
-
Stops the current navigation.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func stop()
TomTom SDK for iOS (0.40.0)
DefaultTomTomNavigation