RouteControllerDelegate
public protocol RouteControllerDelegate: class
The RouteControllerDelegate class provides methods for responding to significant occasions during the user’s traversal of a route monitored by a RouteController.
-
Returns whether the route controller should be allowed to calculate a new route.
If implemented, this method is called as soon as the route controller detects that the user is off the predetermined route. Implement this method to conditionally prevent rerouting. If this method returns
true,routeController(_:willRerouteFrom:)will be called immediately afterwards.Declaration
Swift
optional func routeController(_ routeController: RouteController, shouldRerouteFrom location: CLLocation) -> BoolParameters
routeControllerThe route controller that has detected the need to calculate a new route.
locationThe user’s current location.
Return Value
True to allow the route controller to calculate a new route; false to keep tracking the current route.
-
Called immediately before the route controller calculates a new route.
This method is called after
routeController(_:shouldRerouteFrom:)is called, simultaneously with theRouteControllerWillReroutenotification being posted, and beforerouteController(_:didRerouteAlong:)is called.Declaration
Swift
optional func routeController(_ routeController: RouteController, willRerouteFrom location: CLLocation)Parameters
routeControllerThe route controller that will calculate a new route.
locationThe user’s current location.
-
Called immediately after the route controller receives a new route.
This method is called after
routeController(_:willRerouteFrom:)and simultaneously with theRouteControllerDidReroutenotification being posted.Declaration
Swift
optional func routeController(_ routeController: RouteController, didRerouteAlong route: Route)Parameters
routeControllerThe route controller that has calculated a new route.
routeThe new route.
-
Called when the route controller fails to receive a new route.
This method is called after
routeController(_:willRerouteFrom:)and simultaneously with theRouteControllerDidFailToReroutenotification being posted.Declaration
Swift
optional func routeController(_ routeController: RouteController, didFailToRerouteWith error: Error)Parameters
routeControllerThe route controller that has calculated a new route.
errorAn error raised during the process of obtaining a new route.
-
Called when the route controller’s location manager receive a location update.
These locations can be modified due to replay or simulation but they can also derive from regular location updates from a
CLLocationManager.Declaration
Swift
optional func routeController(_ routeController: RouteController, didUpdateLocations locations: [CLLocation])Parameters
routeControllerThe route controller that received the new locations.
locationsThe locations that were received from the associated location manager.
Install in Dash
RouteControllerDelegate Protocol Reference