Other Classes

The following classes are available globally.

  • DispatchTimer is a general-purpose wrapper over the DispatchSourceTimer mechanism in GCD.

    See more

    Declaration

    Swift

    public class DispatchTimer
  • Feedback Model Object for End Of Route Experience.

    Declaration

    Swift

    @objc
    open class EndOfRouteFeedback : NSObject
  • The NavigationEventsManager is responsible for being the liaison between MapboxCoreNavigation and the Mapbox telemetry framework.

    See more

    Declaration

    Swift

    @objc(MBNavigationEventsManager)
    open class NavigationEventsManager : NSObject
  • NavigationLocationManager is the base location manager which handles permissions and background modes.

    See more

    Declaration

    Swift

    @objc(MBNavigationLocationManager)
    open class NavigationLocationManager : CLLocationManager
    extension NavigationLocationManager: RouterDataSource
  • A NavigationRouteOptions object specifies turn-by-turn-optimized criteria for results returned by the Mapbox Directions API.

    NavigationRouteOptions is a subclass of RouteOptions that has been optimized for navigation. Pass an instance of this class into the Directions.calculate(_:completionHandler:) method.

    Note

    NavigationRouteOptions is designed to be used with the Directions and NavigationDirections classes for specifying routing criteria. To customize the user experience in a NavigationViewController, use the NavigationOptions class.
    See more

    Declaration

    Swift

    @objc(MBNavigationRouteOptions)
    open class NavigationRouteOptions : RouteOptions
  • A NavigationMatchOptions object specifies turn-by-turn-optimized criteria for results returned by the Mapbox Map Matching API.

    NavigationMatchOptions is a subclass of MatchOptions that has been optimized for navigation. Pass an instance of this class into the Directions.calculateRoutes(matching:completionHandler:). method.

    Note: it is very important you specify the waypoints for the route. Usually the only two values for this IndexSet will be 0 and the length of the coordinates. Otherwise, all coordinates passed through will be considered waypoints.

    See more

    Declaration

    Swift

    @objc(MBNavigationMatchOptions)
    open class NavigationMatchOptions : MatchOptions
  • A wrapper for the UserDefaults class for navigation-specific settings.

    Properties are prefixed before they are stored in UserDefaults.standard.

    To specify criteria when calculating routes, use the NavigationRouteOptions class. To customize the user experience during a particular turn-by-turn navigation session, use the NavigationOptions class when initializing a NavigationViewController.

    See more

    Declaration

    Swift

    @objc(MBNavigationSettings)
    public class NavigationSettings : NSObject
  • A NavigationDirections object provides you with optimal directions between different locations, or waypoints. The directions object passes your request to a built-in routing engine and returns the requested information to a closure (block) that you provide. A directions object can handle multiple simultaneous requests. A RouteOptions object specifies criteria for the results, such as intermediate waypoints, a mode of transportation, or the level of detail to be returned. In addition to Directions, NavigationDirections provides support for offline routing.

    Each result produced by the directions object is stored in a Route object. Depending on the RouteOptions object you provide, each route may include detailed information suitable for turn-by-turn directions, or it may include only high-level information such as the distance, estimated travel time, and name of each leg of the trip. The waypoints that form the request may be conflated with nearby locations, as appropriate; the resulting waypoints are provided to the closure.

    See more

    Declaration

    Swift

    @objc(MBNavigationDirections)
    public class NavigationDirections : Directions
  • ReplayLocationManager replays an array of locations exactly as they were recorded with the single exception of the location’s timestamp which will be adjusted by interval between locations.

    See more

    Declaration

    Swift

    @objc(MBReplayLocationManager)
    open class ReplayLocationManager : NavigationLocationManager
  • The SimulatedLocationManager class simulates location updates along a given route.

    The route will be replaced upon a RouteControllerDidReroute notification.

    See more

    Declaration

    Swift

    @objc(MBSimulatedLocationManager)
    open class SimulatedLocationManager : NavigationLocationManager
  • A user interface element designed to display the estimated arrival time, distance, and time remaining, as well as give the user a control the cancel the navigation session.

    See more

    Declaration

    Swift

    @IBDesignable
    @objc(MBBottomBannerViewController)
    open class BottomBannerViewController : UIViewController, NavigationComponent
  • A control indicating the direction that the vehicle is traveling towards.

    See more

    Declaration

    Swift

    @objc(MBCarPlayCompassView)
    open class CarPlayCompassView : StylableView
  • CarPlayMapViewController is responsible for administering the Mapbox map, the interface styles and the map template buttons to display on CarPlay.

    See more

    Declaration

    Swift

    @objc(MBCarPlayMapViewController)
    public class CarPlayMapViewController : UIViewController
    extension CarPlayMapViewController: StyleManagerDelegate
  • CarPlaySearchController is the main object responsible for managing the search feature on CarPlay.

    Messages declared in the CPApplicationDelegate protocol should be sent to this object in the containing application’s application delegate. Implement CarPlaySearchControllerDelegate in the containing application and assign an instance to the delegate property of your CarPlaySearchController instance.

    Note

    It is very important you have a single CarPlaySearchController instance at any given time.
    See more

    Declaration

    Swift

    @objc(MBCarPlaySearchController)
    public class CarPlaySearchController : NSObject
    extension CarPlaySearchController: CPSearchTemplateDelegate
    extension CarPlaySearchController: CPListTemplateDelegate
  • CarPlay support requires iOS 12.0 or above and the CarPlay framework.

  • DefaultStyle is default style for Mapbox Navigation SDK.

    See more

    Declaration

    Swift

    @objc(MBDayStyle)
    open class DayStyle : Style
  • NightStyle is the default night style for Mapbox Navigation SDK. Only will be applied when necessary and if automaticallyAdjustStyleForSunPosition.

    See more

    Declaration

    Swift

    @objc(MBNightStyle)
    open class NightStyle : DayStyle
  • A single feedback item displayed on an instance of FeedbackViewController.

    See more

    Declaration

    Swift

    @objc(MBFeedbackItem)
    public class FeedbackItem : NSObject
  • A view controller containing a grid of buttons the user can use to denote an issue their current navigation experience.

    See more

    Declaration

    Swift

    @objc(MBFeedbackViewController)
    public class FeedbackViewController : UIViewController, DismissDraggable, UIGestureRecognizerDelegate
    extension FeedbackViewController: UIViewControllerTransitioningDelegate
    extension FeedbackViewController: UICollectionViewDataSource
    extension FeedbackViewController: UICollectionViewDelegate
    extension FeedbackViewController: UICollectionViewDelegateFlowLayout
  • GenericRouteShield is a class to render routes that do not have route-shields.

    Declaration

    Swift

    public class GenericRouteShield : StylableView
  • The Mapbox voice controller plays spoken instructions using the MapboxSpeech framework.

    You initialize a voice controller using a NavigationService instance. The voice controller observes when the navigation service hints that the user has passed a spoken instruction point and responds by converting the contents of a SpokenInstruction object into audio and playing the audio.

    The MapboxSpeech framework requires a network connection to connect to the Mapbox Voice API, but it produces superior speech output in several languages including English. If the voice controller is unable to connect to the Voice API, it falls back to the Speech Synthesis framework as implemented by the superclass, RouteVoiceController. To mitigate network latency over a cell connection, MapboxVoiceController prefetches and caches synthesized audio.

    If you need to supply a third-party speech synthesizer that requires a network connection, define a subclass of MapboxVoiceController that overrides the speak(_:) method. If the third-party speech synthesizer does not require a network connection, you can instead subclass RouteVoiceController.

    The Mapbox Voice API is optimized for spoken instructions provided by the Mapbox Directions API via the MapboxDirections.swift framework. If you need text-to-speech functionality outside the context of a navigation service, use the Speech Synthesis framework’s AVSpeechSynthesizer class directly.

    See more

    Declaration

    Swift

    @objc(MBMapboxVoiceController)
    open class MapboxVoiceController : RouteVoiceController, AVAudioPlayerDelegate
  • Customization options for the turn-by-turn navigation user experience in a NavigationViewController.

    A navigation options object is where you place customized components that the navigation view controller uses during its lifetime, such as styles or voice controllers. You would likely use this class if you need to specify a Mapbox access token programmatically instead of in the Info.plist file.

    Note

    NavigationOptions is designed to be used with the NavigationViewController class to customize the user experience. To specify criteria when calculating routes, use the NavigationRouteOptions class. To modify user preferences that persist across navigation sessions, use the NavigationSettings class.
    See more

    Declaration

    Swift

    @objc(MBNavigationOptions)
    open class NavigationOptions : NSObject, NavigationCustomizable
  • A view that represents the root view of the MapboxNavigation drop-in UI.

    Components

    1. InstructionsBannerView
    2. InformationStackView
    3. BottomBannerView
    4. ResumeButton
    5. WayNameLabel
    6. FloatingStackView
    7. NavigationMapView
    +--------------------+
    |         1          |
    +--------------------+
    |         2          |
    +----------------+---+
    |                |   |
    |                | 6 |
    |                |   |
    |         7      +---+
    |                    |
    |                    |
    |                    |
    +------------+       |
    |  4  ||  5  |       |
    +------------+-------+
    |         3          |
    +--------------------+
    

    Declaration

    Swift

    @IBDesignable
    @objc(MBNavigationView)
    open class NavigationView : UIView
  • :nodoc

    Declaration

    Swift

    @objc(MBStylableView)
    open class StylableView : UIView
  • A manager that handles Style objects. The manager listens for significant time changes and changes to the content size to apply an approriate style for the given condition.

    See more

    Declaration

    Swift

    @objc(MBStyleManager)
    open class StyleManager : NSObject
  • A view representing the user’s location on screen.

    See more

    Declaration

    Swift

    @objc(MBUserPuckCourseView)
    public class UserPuckCourseView : UIView, UserCourseView