-
Customization options for the navigation preview user experience in a
See morePreviewViewController.Declaration
Swift
public struct PreviewOptions -
PreviewViewControlleris a user interface for the preview mode experience. It allows to present banners that contain information that is important for the user before actually starting turn-by-turn navigation session (e.g. final destination presentation, main and alternative routes preview etc). By default Mapbox Navigation SDK provides such banners:DestinationPreviewViewController- banner that is shown at the bottom of the screen and allows to show information about the final destination, preview available routes and start active navigation sessionRoutePreviewViewController- banner that is shown at the bottom of the screen and allows to preview information about the currentRoute(expected travel time, distance and expected time of arrival)BannerDismissalViewController- banner that is shown at the top of the screen and allows to dismiss already presented banner
Internally
PreviewViewControllerrelies on two components:NavigationMapView- wrapsMapViewand provides convenience functions for adding and removing route lines, route duration annotations, shows user location indicator etcNavigationView- wrapsNavigationMapViewand provides the ability to show drop-in related UI components likeSpeedLimitView,WayNameView, top and bottomBannerContainerViews etc
See morePreviewViewControllerworks as an initial step before switching to the active navigation. UseNavigationViewControllerfor turn-by-turn navigation experience.Declaration
Swift
public class PreviewViewController : UIViewControllerextension PreviewViewController: StyleManagerDelegate -
Declaration
Swift
public protocol PreviewViewControllerDelegate : AnyObject, UnimplementedLogging -
A banner protocol provides the ability to show content inside
NavigationView. Components that conform toBannerprotocol must be instances of theUIViewController. Banners are injected intoBannerContainerViewand can have various properties: can be shown at the top or at the bottom of the screen, can be expanded and collapsed and can have custom height.By default Mapbox Navigation SDK provides several default banners:
DestinationPreviewViewController- banner that is shown at the bottom of the screen and allows to show information about the final destination, preview available routes and start active navigation sessionRoutePreviewViewController- banner that is shown at the bottom of the screen and allows to preview information about the currentRoute(expected travel time, distance and expected time of arrival)BannerDismissalViewController- banner that is shown at the top of the screen and allows to dismiss already presented banner
Declaration
Swift
public protocol Banner : UIViewController -
Configuration of the banner that allows to change its default behavior.
See moreDeclaration
Swift
public struct BannerConfiguration -
Banner that is shown at the top of the screen and allows to dismiss already presented banners that were added to the
See morePreviewViewController.Declaration
Swift
public class BannerDismissalViewController : UIViewController, Banner -
The interface for an object that serves as the banner dismissal delegate.
See moreDeclaration
Swift
public protocol BannerDismissalViewControllerDelegate : AnyObject -
Banner that is shown at the bottom of the screen and allows to show final destination information in
See morePreviewViewController.Declaration
Swift
public class DestinationPreviewViewController : UIViewController, Banner, DestinationDataSource -
The interface for an object that serves as the destination preview delegate.
See moreDeclaration
Swift
public protocol DestinationPreviewViewControllerDelegate : AnyObject -
Customization options for the destination(s) preview using
See moreDestinationPreviewViewControllerbanner.Declaration
Swift
public struct DestinationOptions -
A protocol, that allows to provide destination information.
Bannerinstances should conform to this protocol, to provide the options that are required for the destination presentation in thePreviewViewController.By default Mapbox Navigation SDK provides
See moreDestinationPreviewViewControllerthat conforms to this protocol and allows to present banner that shows final destination related information.Declaration
Swift
public protocol DestinationDataSource : AnyObject -
Banner that is shown at the bottom of the screen and allows to show route-related information in
See morePreviewViewController.Declaration
Swift
public class RoutePreviewViewController : UIViewController, Banner, RoutePreviewDataSource -
The interface for an object that serves as the routes preview delegate.
See moreDeclaration
Swift
public protocol RoutePreviewViewControllerDelegate : AnyObject -
Customization options for the routes(s) preview using
See moreRoutePreviewViewControllerbanner.Declaration
Swift
public struct RoutePreviewOptions -
A protocol, that allows to provide routes related information.
Bannerinstances should conform to this protocol, to provide the options that are required for the route(s) presentation in thePreviewViewController.By default Mapbox Navigation SDK provides
See moreRoutePreviewViewControllerthat conforms to this protocol and allows to present banner that shows route related information (expected travel time, arrival time and duration).Declaration
Swift
public protocol RoutePreviewDataSource : AnyObject
Install in Dash
Preview Reference