Mapbox Navigation SDK for iOS Docs Navigation SDK for iOS Reference (2.8.1)

View on GitHub

Install in Dash

Mapbox Navigation SDK for iOS Reference Turn-by-turn UI Reference
  • Guides
    • Using Map Matching
    • Reduce Memory Usage
    • Styling the UI
  • Turn-by-turn UI
    • NavigationViewController
    • NavigationViewControllerDelegate
    • RouteVoiceController
    • SpeechSynthesizing
    • SpeechSynthesizingDelegate
    • MapboxSpeechSynthesizer
    • SystemSpeechSynthesizer
    • MultiplexedSpeechSynthesizer
    • SpeechError
    • SpeechFailureAction
    • NavigationOptions
    • NavigationView
  • Core Navigation Logic
    • NavigationService
    • NavigationServiceDelegate
    • MapboxNavigationService
    • – NotificationUserInfoKey
    • Router
    • RouterDataSource
    • RouteController
    • – NotificationUserInfoKey
    • RouterDelegate
    • RouteProgress
    • RouteLegProgress
    • RouteStep
    • RouteStepProgress
    • CongestionLevel
    • VisualInstruction
    • VisualInstructionDelegate
    • NavigationEventsManager
    • ActiveNavigationEventsManagerDataSource
    • PassiveNavigationEventsManagerDataSource
    • NavigationLocationManager
    • ReplayLocationManager
    • SimulatedLocationManager
    • NavigationRouteOptions
    • RouteOptions
    • NavigationMatchOptions
    • SimulationMode
    • PassiveLocationManager
    • – NotificationUserInfoKey
    • HistoryRecording
  • Maps
    • NavigationMapView
    • NavigationMapViewDelegate
    • MapView
    • PassiveLocationProvider
    • NavigationLocationProvider
    • WaypointStyle
    • UserLocationStyle
  • Styling
    • Style
    • StyleManager
    • StyleManagerNotificationUserInfoKey
    • StyleManagerDelegate
    • DayStyle
    • NightStyle
  • Formatters
    • DistanceFormatter
  • UI Components
    • BottomBannerViewController
    • BottomBannerViewControllerDelegate
    • SpeedLimitView
    • UserPuckCourseView
    • UserHaloCourseView
    • CourseUpdatable
    • NavigationComponent
  • Guidance Instruction UI
    • TopBannerViewController
    • InstructionsCardViewController
    • InstructionsCardContainerView
    • InstructionsCardContainerViewDelegate
    • InstructionsBannerView
    • InstructionsBannerViewDelegate
    • BaseInstructionsBannerView
    • ManeuverView
    • JunctionView
    • GenericRouteShield
  • CarPlay
    • CarPlayManager
    • CarPlayManagerDelegate
    • CarPlayNavigationViewController
    • CarPlayNavigationViewControllerDelegate
    • CarPlayActivity
    • CarPlayCompassView
    • CarPlayMapViewController
    • CarPlayMapViewControllerDelegate
    • CarPlaySearchController
    • CarPlaySearchControllerDelegate
    • CarPlayConnectionObserver
    • RecentItem
    • NavigationGeocodedPlacemark
  • Configuration
    • RouteControllerDeadReckoningTimeInterval
    • RouteControllerMediumAlertInterval
    • RouteControllerHighAlertInterval
    • RouteControllerManeuverZoneRadius
    • RouteSnappingMaxManipulatedCourseAngle
    • RouteControllerMaximumAllowedDegreeOffsetForTurnCompletion
    • RouteControllerMaximumDistanceBeforeRecalculating
    • RouteControllerUserLocationSnappingDistance
    • MapOrnamentPosition
    • CongestionAttribute
    • CurrentLegAttribute
    • RouteLineWidthByZoomLevel
    • NavigationMapViewMinimumDistanceForOverheadZooming
    • NavigationViewMinimumVolumeForWarning
    • GradientCongestionFadingDistance
    • RouteControllerIncorrectCourseMultiplier
    • RouteControllerLinkedInstructionBufferMultiplier
    • RouteControllerMaximumSpeedForUsingCurrentStep
    • RouteControllerMinNumberOfInCorrectCourses
    • RouteControllerMinimumBacktrackingDistanceForRerouting
    • RouteControllerMinimumDistanceForContinueInstruction
    • RouteControllerMinimumDurationRemainingForProactiveRerouting
    • RouteControllerMinimumNumberLocationUpdatesBackwards
    • RouteControllerNumberOfSecondsForRerouteFeedback
    • RouteControllerProactiveReroutingInterval
    • RouteSnappingMinimumHorizontalAccuracy
    • RouteSnappingMinimumSpeed
    • NavigationSettings
  • User Feedback
    • FeedbackViewController
    • FeedbackViewControllerDelegate
    • FeedbackItem
    • ActiveNavigationFeedbackType
    • PassiveNavigationFeedbackType
    • PassiveNavigationIncorrectVisualSubtype
    • ConfusingAudioSubtype
    • RouteQualitySubtype
    • IllegalRouteSubtype
    • RoadClosureSubtype
    • FeedbackSource
    • EndOfRouteFeedback
  • Camera
    • NavigationCamera
    • NavigationCameraType
    • NavigationCameraState
    • CameraStateTransition
    • NavigationCameraStateTransition
    • ViewportDataSource
    • NavigationViewportDataSource
    • ViewportDataSourceType
    • ViewportDataSourceDelegate
  • Electronic Horizon
    • ElectronicHorizonOptions
    • RoadGraph
    • – NotificationUserInfoKey
    • – Edge
    • – Path
    • – Position
    • – SubgraphEdge
    • OpenLRIdentifier
    • OpenLROrientation
    • RoadName
    • RoadObject
    • – EdgeLocation
    • – Kind
    • – Location
    • – Position
    • DistancedRoadObject
    • RoadObjectMatcher
    • RoadObjectStore
    • RoadObjectMatcherDelegate
    • RoadObjectStoreDelegate
    • RoadObjectMatcherError
  • Other Classes
    • DispatchTimer
    • – State
    • FeedbackEvent
    • FloatingButton
    • MapboxRoutingProvider
    • – Source
    • – Request
    • PredictiveCacheManager
    • StepInstructionsView
    • StepTableViewCell
    • WayNameLabel
    • WayNameView
  • Other Global Variables
    • CongestionRangeHeavy
    • CongestionRangeLow
    • CongestionRangeModerate
    • CongestionRangeSevere
    • RestrictedRoadClassAttribute
  • Other Enumerations
    • AlternativeRouteError
    • FeedbackScreenshotOption
    • LooksIncorrectSubtype
    • OpenLRSideOfRoad
    • PassiveNavigationRoadIssueSubtype
    • PassiveNavigationWrongTrafficSubtype
    • ReroutingError
    • RoutesPresentationStyle
    • SimulationIntent
    • SimulationState
  • Other Extensions
    • Array
    • Bundle
    • CGPoint
    • CGSize
    • CLLocation
    • CPInterfaceController
    • CameraOptions
    • CongestionRange
    • Dictionary
    • Directions
    • Locale
    • MapboxNavigationNative.RoadObjectMatcherError
    • MapboxStreetsRoadClass
    • Measurement
    • NSAttributedString
    • – Key
    • Notification
    • – Name
    • ResourceOptionsManager
    • RouteLeg
    • String
    • StyleURI
    • TileStore
    • TilesetDescriptorFactory
    • UIApplication
    • – State
    • UIDevice
    • UIEdgeInsets
    • UIFont
    • UIWindow
    • URLSessionDataTask
  • Other Protocols
    • BimodalCache
    • BimodalDataCache
    • BimodalImageCache
    • FeedbackType
    • NavigationMapInteractionObserver
    • NavigationProviderRequest
    • NavigationStatusPresenter
    • PassiveLocationManagerDelegate
    • RouteVoiceControllerDelegate
    • RoutingProvider
    • StepsViewControllerDelegate
    • TopBannerViewControllerDelegate
    • UnimplementedLogging
  • Other Structures
    • AlternativeRoute
    • – RouteInfo
    • AlternativeRouteDetectionStrategy
    • – RefreshOnEmpty
    • BearingSmoothing
    • BorderCrossing
    • FollowingCameraOptions
    • GeometryFramingAfterManeuver
    • IncidentsOptions
    • IndexedRouteResponse
    • IntersectionDensity
    • MapMatchingResult
    • NavigationViewportDataSourceOptions
    • OverviewCameraOptions
    • PitchNearManeuver
    • PredictiveCacheOptions
    • RouteAlert
    • StatusUpdatingSettings
    • TileStoreConfiguration
    • – Location
    • Tunnel
  • Other Type Aliases
    • AdvanceLegCompletionHandler
    • CarPlayUserInfo
    • CongestionRange
    • ContainerViewController
    • RoutingProviderSource
    • UserCourseView

Turn-by-turn UI

  • NavigationViewController

    NavigationViewController is a fully-featured user interface for turn-by-turn navigation. Do not confuse it with the NavigationController class in UIKit.

    You initialize a navigation view controller based on a predefined RouteResponse and NavigationOptions. As the user progresses along the route, the navigation view controller shows their surroundings and the route line on a map. Banners above and below the map display key information pertaining to the route. A list of steps and a feedback mechanism are accessible via the navigation view controller.

    Route initialization should be configured before view controller’s view is loaded. Usually, that is automatically done during any of the inits, but you may also change this settings via prepareViewLoading(routeResponse:, routeIndex:, routeOptions:, navigationOptions:) methods. For example that could be handy while configuring a ViewController for a UIStoryboardSegue.

    To be informed of significant events and decision points as the user progresses along the route, set the NavigationService.delegate property of the NavigationService that you provide when creating the navigation options.

    CarPlayNavigationViewController manages the corresponding user interface on a CarPlay screen.

    Important

    Creating an instance of this type with parameters that uses RouteController with will start an Active Guidance session. The trip session is stopped when the instance is deallocated. For more info read the Pricing Guide.
    See more

    Declaration

    Swift

    open class NavigationViewController : UIViewController, NavigationStatusPresenter, NavigationViewData, BuildingHighlighting
    extension NavigationViewController: NavigationServiceDelegate
    extension NavigationViewController: StyleManagerDelegate
    extension NavigationViewController: TopBannerViewControllerDelegate
    extension NavigationViewController: BottomBannerViewControllerDelegate
    extension NavigationViewController: CarPlayConnectionObserver
    extension NavigationViewController: NavigationMapViewDelegate
    View Source on GitHub
  • NavigationViewControllerDelegate

    The NavigationViewControllerDelegate protocol provides methods for configuring the map view shown by a NavigationViewController and responding to the cancellation of a navigation session.

    For convenience, several location-related methods in the NavigationServiceDelegate protocol have corresponding methods in this protocol.

    See more

    Declaration

    Swift

    public protocol NavigationViewControllerDelegate : VisualInstructionDelegate
    View Source on GitHub
  • RouteVoiceController

    A route voice controller monitors turn-by-turn navigation events and triggers playing spoken instructions as audio using the instance of SpeechSynthesizing type.

    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 calling it’s speechSynthesizer to handle the vocalization.

    If you want to use your own custom SpeechSynthesizing implementation - also pass it during initialization. If no implementation is provided - MultiplexedSpeechSynthesizer will be used by default.

    You can also subclass RouteVoiceController to implement you own mechanism of monitoring navgiation events and calling speechSynthesizer.

    See more

    Declaration

    Swift

    open class RouteVoiceController : NSObject, AVSpeechSynthesizerDelegate
    View Source on GitHub
  • SpeechSynthesizing

    Protocol for implementing speech synthesizer to be used in RouteVoiceController.

    See more

    Declaration

    Swift

    public protocol SpeechSynthesizing : AnyObject
    View Source on GitHub
  • SpeechSynthesizingDelegate

    The SpeechSynthesizingDelegate protocol defines methods that allow an object to respond to significant events related to spoken instructions.

    See more

    Declaration

    Swift

    public protocol SpeechSynthesizingDelegate : AnyObject, UnimplementedLogging
    View Source on GitHub
  • MapboxSpeechSynthesizer

    SpeechSynthesizing implementation, using MapboxSpeech framework. Uses pre-caching mechanism for upcoming instructions.

    See more

    Declaration

    Swift

    open class MapboxSpeechSynthesizer : NSObject, SpeechSynthesizing
    extension MapboxSpeechSynthesizer: AVAudioPlayerDelegate
    View Source on GitHub
  • SystemSpeechSynthesizer

    SpeechSynthesizing implementation, using AVSpeechSynthesizer.

    See more

    Declaration

    Swift

    open class SystemSpeechSynthesizer : NSObject, SpeechSynthesizing
    extension SystemSpeechSynthesizer: AVSpeechSynthesizerDelegate
    View Source on GitHub
  • MultiplexedSpeechSynthesizer

    SpeechSynthesizingimplementation, aggregating other implementations, to allow ‘fallback’ mechanism. Can be initialized with array of synthesizers which will be called in order of appearance, until one of them is capable to vocalize current SpokenInstruction

    See more

    Declaration

    Swift

    open class MultiplexedSpeechSynthesizer : SpeechSynthesizing
    extension MultiplexedSpeechSynthesizer: SpeechSynthesizingDelegate
    View Source on GitHub
  • SpeechError

    A error type returned when encountering errors in the speech engine.

    See more

    Declaration

    Swift

    public enum SpeechError : LocalizedError
    View Source on GitHub
  • SpeechFailureAction

    The speech-related action that failed.

    Seealso

    SpeechError
    See more

    Declaration

    Swift

    public enum SpeechFailureAction : String
    View Source on GitHub
  • NavigationOptions

    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

    open class NavigationOptions : NavigationCustomizable
    View Source on GitHub
  • NavigationView

    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
    8. SpeedLimitView
    +--------------------+
    |         1          |
    +--------------------+
    |         2          |
    +---+------------+---+
    | 8 |            |   |
    +---+            | 6 |
    |                |   |
    |         7      +---+
    |                    |
    |                    |
    |                    |
    +------------+       |
    |  4  ||  5  |       |
    +------------+-------+
    |         3          |
    +--------------------+
    

    Declaration

    Swift

    @IBDesignable
    open class NavigationView : UIView
    View Source on GitHub

© 2014–2022 Mapbox. See license for more details.

Generated by jazzy ♪♫ v0.14.2, a Realm project.