Skip to content

Separate search component from the main carplay manager. - #1846

Merged
vincethecoder merged 29 commits into
masterfrom
kobe/carplay-search-manager
Jan 4, 2019
Merged

vincethecoder merged 29 commits into
masterfrom
kobe/carplay-search-manager

Conversation

@vincethecoder

Copy link
Copy Markdown
Contributor

Modifications to make the main CarPlay manager and search feature are managed by two different classes.

Addresses #1839

/cc @akitchen @mapbox/navigation-ios

@vincethecoder vincethecoder self-assigned this Nov 20, 2018
@vincethecoder vincethecoder added wip CarPlay Bugs, improvements and feature requests on Apple CarPlay op-ex Refactoring, Tech Debt or any other operational excellence work. labels Nov 20, 2018
# 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")

@frederoni frederoni Nov 22, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing because we need a delegate dedicated to CarPlaySearchManager CarPlaySearchController. There is an upcoming commit for this hence the placeholder for this effort.

@vincethecoder vincethecoder added the ⚠️ DO NOT MERGE PR should not be merged! label Dec 6, 2018
@vincethecoder vincethecoder added ✓ ready for review and removed ⚠️ DO NOT MERGE PR should not be merged! wip labels Dec 18, 2018
@available(iOS 12.0, *)
extension CarPlayManager: CPSearchTemplateDelegate {

extension CarPlaySearchController: CPSearchTemplateDelegate {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO still relevant?

Comment thread Example/AppDelegate+CarPlay.swift Outdated
searchTemplate.delegate = carPlaySearchController
let searchButton = carPlaySearchController.searchTemplateButton(searchTemplate: searchTemplate, interfaceController: interfaceController, traitCollection: traitCollection)
return [searchButton]
default:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this switch case exhaustive w/o using default to prevent regressions if we would add another activity?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

@JThramer JThramer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@JThramer

JThramer commented Jan 4, 2019

Copy link
Copy Markdown
Contributor

Posterity: Spoke with Kobe about this, digressing.

@vincethecoder
vincethecoder merged commit 523a598 into master Jan 4, 2019
@akitchen akitchen added this to the v0.28.0 milestone Jan 5, 2019
@1ec5
1ec5 deleted the kobe/carplay-search-manager branch December 5, 2019 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CarPlay Bugs, improvements and feature requests on Apple CarPlay op-ex Refactoring, Tech Debt or any other operational excellence work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants