NavigationStateChangeObserver
public protocol NavigationStateChangeObserver : Observer
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 StateChangeObserver: NavigationStateChangeObserver {
func didChangeNavigationState(navigationState: NavigationState) {
// add code that handles navigation state changes
}
}
Then add the observer using addNavigationStateChangeObserver(_:)
.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Called 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.