@@ -29,15 +29,25 @@ class CustomBarsViewController: UIViewController {
29
29
}
30
30
31
31
// For demonstration purposes, simulate locations if the Simulate Navigation option is on.
32
- let navigationService = MapboxNavigationService ( routeResponse: response, routeIndex: 0 , routeOptions: routeOptions, simulating: simulationIsEnabled ? . always : . onPoorGPS)
32
+ let navigationService = MapboxNavigationService ( routeResponse: response,
33
+ routeIndex: 0 ,
34
+ routeOptions: routeOptions,
35
+ routingProvider: NavigationSettings . shared. directions,
36
+ credentials: NavigationSettings . shared. directions. credentials,
37
+ simulating: simulationIsEnabled ? . always : . onPoorGPS)
33
38
34
39
// Pass your custom implementations of `topBanner` and/or `bottomBanner` to `NavigationOptions`
35
40
// If you do not specify them explicitly, `TopBannerViewController` and `BottomBannerViewController` will be used by default.
36
41
// Those are `Open`, so you can also check thier source for more examples of using standard UI controls!
37
42
let topBanner = CustomTopBarViewController ( )
38
43
let bottomBanner = CustomBottomBarViewController ( )
39
- let navigationOptions = NavigationOptions ( navigationService: navigationService, topBanner: topBanner, bottomBanner: bottomBanner)
40
- let navigationViewController = NavigationViewController ( for: response, routeIndex: 0 , routeOptions: routeOptions, navigationOptions: navigationOptions)
44
+ let navigationOptions = NavigationOptions ( navigationService: navigationService,
45
+ topBanner: topBanner,
46
+ bottomBanner: bottomBanner)
47
+ let navigationViewController = NavigationViewController ( for: response,
48
+ routeIndex: 0 ,
49
+ routeOptions: routeOptions,
50
+ navigationOptions: navigationOptions)
41
51
bottomBanner. navigationViewController = navigationViewController
42
52
43
53
let parentSafeArea = navigationViewController. view. safeAreaLayoutGuide
0 commit comments