File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ public extension CPInterfaceController {
12
12
animated or not.
13
13
*/
14
14
func safePopTemplate( animated: Bool ) {
15
- if templates. count >= 1 { return }
16
-
15
+ guard templates. count > 1 else { return }
16
+
17
17
popTemplate ( animated: animated)
18
18
}
19
19
}
Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ 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
-
105
+ private let semaphore = DispatchSemaphore ( value: 1 )
106
+
106
107
/**
107
108
Programatically begins a CarPlay turn-by-turn navigation session.
108
109
@@ -653,6 +654,9 @@ extension CarPlayManager {
653
654
}
654
655
655
656
func previewRoutes( for trip: CPTrip ) {
657
+ semaphore. wait ( )
658
+ defer { semaphore. signal ( ) }
659
+
656
660
guard let traitCollection = ( self . carWindow? . rootViewController as? CarPlayMapViewController ) ? . traitCollection,
657
661
let interfaceController = interfaceController else {
658
662
return
You can’t perform that action at this time.
0 commit comments