Other Protocols

The following protocols are available globally.

  • The EventsManagerDataSource protocol declares values required for recording route following events.

    See more
  • A navigation service delegate interacts with one or more NavigationService instances (such as MapboxNavigationService objects) during turn-by-turn navigation. This protocol is the main way that your application can synchronize its state with the SDK’s location-related functionality. Each of the protocol’s methods is optional.

    As the user progresses along a route, a navigation service informs its delegate about significant events as they occur, and the delegate has opportunities to influence the route and its presentation. For example, when the navigation service reports that the user has arrived at the destination, your delegate implementation could present information about the destination. It could also customize individual visual or spoken instructions along the route by returning modified instruction objects.

    Assign a NavigationServiceDelegate instance to the NavigationService.delegate property of the navigation service before you start the service.

    The RouterDelegate protocol defines corresponding methods so that a Router instance can interact with an object that is both a router delegate and a navigation service, which in turn interacts with a navigation service delegate. Additionally, several location-related methods in this protocol have corresponding methods in the NavigationViewControllerDelegate protocol, which can be convenient if you are using the navigation service in conjunction with a NavigationViewController. Normally, you would either implement methods in NavigationServiceDelegate or NavigationViewControllerDelegate but not RouterDelegate.

    Seealso

    NavigationViewControllerDelegate

    Seealso

    RouterDelegate
    See more
  • A router data source, also known as a location manager, supplies location data to a Router instance. For example, a MapboxNavigationService supplies location data to a RouteController or LegacyRouteController.

    See more
  • A class conforming to the Router protocol tracks the user’s progress as they travel along a predetermined route. It calls methods on its delegate, which conforms to the RouterDelegate protocol, whenever significant events or decision points occur along the route. Despite its name, this protocol does not define the interface of a routing engine.

    There are two concrete implementations of the Router protocol. RouteController, the default implementation, is capable of client-side routing and depends on the Mapbox Navigation Native framework. LegacyRouteController is an alternative implementation that does not have this dependency but must be used in conjunction with the Mapbox Directions API over a network connection.

    See more
  • A router delegate interacts with one or more Router instances, such as RouteController objects, during turn-by-turn navigation. This protocol is similar to NavigationServiceDelegate, which is the main way that your application can synchronize its state with the SDK’s location-related functionality. Normally, you should not need to make a class conform to the RouterDelegate protocol or call any of its methods directly, but you would need to call this protocol’s methods if you implement a custom Router class.

    MapboxNavigationService is the only concrete implementation of a router delegate. Implement the NavigationServiceDelegate protocol instead to be notified when various significant events occur along the route tracked by a NavigationService.

    Seealso

    MapboxNavigationService

    Seealso

    NavigationServiceDelegate
    See more
  • Protocols that provide no-op default method implementations can use this protocol to log a message to the console whenever an unimplemented delegate method is called.

    In Swift, optional protocol methods exist only for Objective-C compatibility. However, various protocols in this library follow a classic Objective-C delegate pattern in which the protocol would have a number of optional methods. Instead of the disallowed optional keyword, these protocols conform to the UnimplementedLogging protocol to inform about unimplemented methods at runtime. These console messages are logged to the subsystem com.mapbox.com with a category of the format “delegation.ProtocolName”, where ProtocolName is the name of the protocol that defines the method.

    The default method implementations should be provided as part of the protocol or an extension thereof. If the default implementations reside in an extension, the extension should have the same visibility level as the protocol itself.

    See more
  • BottomBannerViewControllerDelegate provides a method for reacting to the user tapping on the “cancel” button in the BottomBannerViewController.

    See more
  • A cache consists of both in-memory and on-disk components, both of which can be reset.

    See more
  • A cache which supports storing images

    See more
  • A cache which supports storing data

    See more
  • The FeedbackViewControllerDelegate protocol provides methods for responding to feedback events.

    See more
  • The VisualInstructionDelegate protocol defines a method that allows an object to customize presented visual instructions.

    See more
  • InstructionsBannerViewDelegate provides methods for reacting to user interactions in InstructionsBannerView.

    See more
  • A navigation component is a member of the navigation UI view hierarchy that responds as the user progresses along a route according to the NavigationServiceDelegate protocol.

  • The NavigationInteractionDelegate protocol is used to define interaction events that the top banner may need to know about.

    See more
  • The CarPlayConnectionObserver protocol provides notification of a carplay unit connecting two the NavigationViewController.

    See more
  • This protocol defines a UI Component that is capable of presenting a status message.

    See more