File tree 3 files changed +22
-5
lines changed
3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Changes to the Mapbox Navigation SDK for iOS
2
2
3
+ ## v2.18.2
4
+
5
+ ### CarPlay
6
+
7
+ * Fixed CarPlay crash when calling ` CarPlayManager.routePreview() ` function for iOS 14+.
8
+
3
9
## v2.18.1
4
10
5
11
### CarPlay
6
12
7
- * Fixed CarPlay crash when calling ` CarPlayManager.routePreview() ` function.
13
+ * Partially fixed CarPlay crash when calling ` CarPlayManager.routePreview() ` function.
8
14
9
15
## v2.18.0
10
16
Original file line number Diff line number Diff line change @@ -237,6 +237,12 @@ class ViewController: UIViewController {
237
237
guard let delegate = UIApplication . shared. delegate as? AppDelegate else { return }
238
238
if let indexedRouteResponse = indexedRouteResponse {
239
239
delegate. carPlayManager. previewRoutes ( for: indexedRouteResponse)
240
+
241
+ // debug
242
+ // By enabling following lines, it makes easy to reproduce the same crash.
243
+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
244
+ delegate. carPlayManager. previewRoutes ( for: indexedRouteResponse)
245
+ }
240
246
} else {
241
247
delegate. carPlayManager. cancelRoutesPreview ( )
242
248
}
@@ -251,7 +257,15 @@ class ViewController: UIViewController {
251
257
}
252
258
253
259
@IBAction func simulateButtonPressed( _ sender: Any ) {
254
- simulationButton. isSelected = !simulationButton. isSelected
260
+ // simulationButton.isSelected = !simulationButton.isSelected
261
+
262
+ let destinationCoordinate = CLLocationCoordinate2D ( latitude: 37.957453 , longitude: - 122.523200 )
263
+ let waypoint = Waypoint ( coordinate: destinationCoordinate, name: " Dropped Pin # \( waypoints. endIndex + 1 ) " )
264
+
265
+ waypoint. targetCoordinate = destinationCoordinate
266
+ waypoints = [ waypoint]
267
+
268
+ requestRoute ( )
255
269
}
256
270
257
271
@IBAction func clearMapPressed( _ sender: Any ) {
Original file line number Diff line number Diff line change @@ -102,7 +102,6 @@ public class CarPlayManager: NSObject {
102
102
private weak var navigationService : NavigationService ?
103
103
private var idleTimerCancellable : IdleTimerManager . Cancellable ?
104
104
private var indexedRouteResponse : IndexedRouteResponse ?
105
- private let semaphore = DispatchSemaphore ( value: 1 )
106
105
107
106
/**
108
107
Programatically begins a CarPlay turn-by-turn navigation session.
@@ -654,8 +653,6 @@ extension CarPlayManager {
654
653
}
655
654
656
655
func previewRoutes( for trip: CPTrip ) {
657
- semaphore. wait ( )
658
- defer { semaphore. signal ( ) }
659
656
660
657
guard let traitCollection = ( self . carWindow? . rootViewController as? CarPlayMapViewController ) ? . traitCollection,
661
658
let interfaceController = interfaceController else {
You can’t perform that action at this time.
0 commit comments