NavigationWaypointArrivalObserver

public protocol NavigationWaypointArrivalObserver : Observer

Declares an observer that can receive navigation events related with visiting waypoints.

The waypoint arrival state changes are detected by the ArrivalDetectionEngine. Different observer methods are called depending on what state has been detected by the ArrivalDetectionEngine:

To be notified about the waypoint arrival events while navigating, first implement the NavigationWaypointArrivalObserver protocol:

class CustomNavigationWaypointArrivalObserver: NavigationWaypointArrivalObserver {
    func didArriveAtWaypoint(waypoint: RouteStop, on route: Route) {
        // Add code here that handles an arrival at a waypoint.
    }

    func didDepartFromWaypoint(waypoint: RouteStop, on route: Route) {
        // Add code here that handles a departure from a waypoint.
    }
}

Then add this observer using addWaypointArrivalObserver(_:).

To stop receiving these events, remove the observer using removeWaypointArrivalObserver(_:).

  • Notifies when arrival is detected at the given waypoint. It marks the start of the waypoint arrival experience.

    Declaration

    Swift

    func didArriveAtWaypoint(waypoint: RouteStop, on route: Route)

    Parameters

    waypoint

    The waypoint that has been reached.

    route

    The current route.

  • Notifies when a departure is detected from the given waypoint. It marks the end of the waypoint arrival experience.

    Declaration

    Swift

    func didDepartFromWaypoint(waypoint: RouteStop, on route: Route)

    Parameters

    waypoint

    The waypoint from where the driver departed.

    route

    The current route.