NavigationStateChangeObserver
public protocol NavigationStateChangeObserver : Observer
Declares an observer that can receive navigationState
change events.
The navigation state changes when the navigation session is started, resumed, stopped, or updated from from free driving to active guidance.
For more information on navigation states, see
the NavigationState
and navigationState
documentation.
To be informed of navigation state updates implement NavigationStateChangeObserver
:
class CustomStateChangeObserver: NavigationStateChangeObserver {
func didChangeNavigationState(navigationState: NavigationState) {
// add code that handles navigation state changes
}
}
Then add the observer using
addNavigationStateChangeObserver(_:)
.
To stop receiving these events, remove the observer using
removeNavigationStateChangeObserver(_:)
.
-
Notifies whenever the navigation state is changed. For more information on navigation states, see
NavigationState
.Declaration
Swift
func didChangeNavigationState(navigationState: NavigationState)
Parameters
navigationState
The current navigation state.