NavigationRouteUpdateObserver
public protocol NavigationRouteUpdateObserver : Observer
Declares an observer that can receive the current route has been updated.
The current route is updated under the following circumstances:
- When the route data is refreshed with data from the replanned route.
- When instructions and lane guidance are incrementally updated for the current route.
To receive notifications of a route being updated, first implement an observer object that conforms to NavigationRouteUpdateObserver
, for example:
class CustomRouteObserver: NavigationRouteUpdateObserver { ... }
In order to complete conformance, the observer object must implement the following callback:
func didUpdateRoute(route: reason:) {
// add code here that handles the route being updated
}
Next, add this observer with navigation using TomTomNavigation/addRouteUpdateObserver(_:)`.
To stop notifications of a route being updated, remove the observer using
TomTomNavigation/removeRouteUpdateObserver(_:)“.
Please note that the NavigationRouteUpdateObserver
is notified only when the route is updated. It means that the route geometry is preserved.
When a route update happens the active route does not change, therefore the NavigationActiveRouteChangeObserver
is not notified.
To receive notifications of route changes that result in the geometry change, refer to the NavigationRouteAddObserver
, NavigationRouteRemoveObserver
and the NavigationActiveRouteChangeObserver
.
-
Notifies whenever a
Route
has been successfully updated.Declaration
Swift
func didUpdateRoute(route: Route, reason: RouteUpdatedReason)