-
Returns whether the navigation service should be allowed to calculate a new route.
If implemented, this method is called as soon as the navigation service detects that the user is off the predetermined route. Implement this method to conditionally prevent rerouting. If this method returns
true
,navigationService(_:willRerouteFrom:)
will be called immediately afterwards. -
Called immediately before the navigation service calculates a new route.
This method is called after
navigationService(_:shouldRerouteFrom:)
is called, simultaneously with theNavigationServiceWillReroute
notification being posted, and beforenavigationService(_:didRerouteAlong:)
is called. -
Called when a location has been identified as unqualified to navigate on.
See
CLLocation.isQualified
for more information about what qualifies a location.- return: If
true
, the location is discarded and theNavigationService
will not consider it. Iffalse
, the location will not be thrown out.
- return: If
-
Called immediately after the navigation service receives a new route.
This method is called after
navigationService(_:willRerouteFrom:)
and simultaneously with theNavigationServiceDidReroute
notification being posted. -
Called when the navigation service fails to receive a new route.
This method is called after
navigationService(_:willRerouteFrom:)
and simultaneously with theNavigationServiceDidFailToReroute
notification being posted. -
Called when the navigation service updates the route progress model.
-
Called as the navigation service approaches a waypoint.
This message is sent, once per progress update, as the user is approaching a waypoint. You can use this to cue UI, to do network pre-loading, etc.
Important
This method will likely be called several times as you approach a destination. If only one consumption of this method is desired, then usage of an internal flag is recommended. -
Called when the navigation service arrives at a waypoint.
You can implement this method to prevent the navigation service from automatically advancing to the next leg. For example, you can and show an interstitial sheet upon arrival and pause navigation by returning
false
, then continue the route when the user dismisses the sheet. If this method is unimplemented, the navigation service automatically advances to the next leg when arriving at a waypoint.Postcondition
If you return false, you must manually advance to the next leg: obtain the value of therouteProgress
property, then increment theRouteProgress.legIndex
property. -
Called when the navigation service arrives at a waypoint.
You can implement this method to allow the navigation service to continue check and reroute the user if needed. By default, the user will not be rerouted when arriving at a waypoint.
-
Called when the navigation service will disable battery monitoring.
Implementing this method will allow developers to change whether battery monitoring is disabled when
NavigationService
is deinited. -
Called when the navigation service is about to begin location simulation.
Implementing this method will allow developers to react when
poor GPS
location-simulation is about to start, possibly to show aPoor GPS
banner in the UI. -
Called after the navigation service begins location simulation.
Implementing this method will allow developers to react when
poor GPS
location-simulation has started, possibly to show aPoor GPS
banner in the UI. -
Called when the navigation service is about to end location simulation.
Implementing this method will allow developers to react when
poor GPS
location-simulation is about to end, possibly to hide aPoor GPS
banner in the UI. -
Called after the navigation service ends location simulation.
Implementing this method will allow developers to react when
poor GPS
location-simulation has ended, possibly to hide aPoor GPS
banner in the UI.