Repository navigation
Separate search component from the main carplay manager. - #1846
Conversation
… separately organized classes.
# Conflicts: # MapboxNavigation/CarPlayManager.swift # MapboxNavigation/CarPlaySearchManager+Search.swift
|
|
||
| XCTAssert(fakeInterfaceController.topTemplate?.isKind(of: CPSearchTemplate.self) ?? false, "Expecting a search template to be on top") | ||
| // TODO: Setup leading buttons to be pushed on top of the interface controller | ||
| // XCTAssert(fakeInterfaceController.topTemplate?.isKind(of: CPSearchTemplate.self) ?? false, "Expecting a search template to be on top") |
There was a problem hiding this comment.
this is probably failing because of the same reason as mentioned in https://github.com/mapbox/mapbox-navigation-ios/pull/1846/files#r235715392
There was a problem hiding this comment.
This is failing because we need a delegate dedicated to CarPlaySearchManagerCarPlaySearchController. There is an upcoming commit for this hence the placeholder for this effort.
# Conflicts: # MapboxNavigation/CarPlaySearchManager+Search.swift
projectedLocation - to allow us to get a fixed location N seconds in the future setMinimumSpeedForLocationProjection - to control the lower speed limit for fixed location predictions
…oke the static variable, recentItems. Changes to use the delegate in previewing a route for a selected search result.
# Conflicts: # MapboxCoreNavigationTests/CocoaPodsTest/PodInstall/Podfile.lock
| @available(iOS 12.0, *) | ||
| extension CarPlayManager: CPSearchTemplateDelegate { | ||
|
|
||
| extension CarPlaySearchController: CPSearchTemplateDelegate { |
There was a problem hiding this comment.
Can we fold this extension, perhaps the entire content of this file into CarPlaySearchController.swift? If you want to keep it separated, this file could also be renamed to CarPlaySearchController+CPSearchTemplateDelegate.swift.
| let searchButton = template.leadingNavigationBarButtons.first! | ||
| searchButton.handler!(searchButton) | ||
|
|
||
| // TODO: Setup leading buttons to be pushed on top of the interface controller |
There was a problem hiding this comment.
Is this TODO still relevant?
| searchTemplate.delegate = carPlaySearchController | ||
| let searchButton = carPlaySearchController.searchTemplateButton(searchTemplate: searchTemplate, interfaceController: interfaceController, traitCollection: traitCollection) | ||
| return [searchButton] | ||
| default: |
There was a problem hiding this comment.
can we make this switch case exhaustive w/o using default to prevent regressions if we would add another activity?
… buttons. Renamed search controller's extension for implementing search template delegate. Removed to-do comment in the carplay manager tests.
JThramer
left a comment
There was a problem hiding this comment.
This looks great, but one thing I might suggest:
It would be really cool to have some sort of example with a "custom" search controller, maybe a simple one that returns baked-in results when you search for "Mapbox"?
# Conflicts: # Cartfile.resolved # MapboxCoreNavigationTests/CocoaPodsTest/PodInstall/Podfile.lock
|
Posterity: Spoke with Kobe about this, digressing. |
Modifications to make the main CarPlay manager and search feature are managed by two different classes.
Addresses #1839
/cc @akitchen @mapbox/navigation-ios