Skip to content

Conversation

@bolsinga
Copy link
Collaborator

  • DemoCarPlaySearch -> this can actually go into the api-search repository. It is designed not to have external dependencies.

- `DemoCarPlaySearch` -> this can actually go into the api-search repository. It is designed not to have external dependencies.
do {
if self.searchText != searchText {
self.searchText = searchText
try await search(query: searchText, autocomplete: false)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only ever be false when the user indicates they are finished searching (i.e. pressing the search button on the on-screen keyboard).

It looks like it's false only to get the full place details with every search, but in doing so, the results will actually be quite a bit worse on partial input (all of the input on mobile :P).

Ideally we'd fetch the details on selection. If that's not possible, lemme know and I've got some other ideas.

Copy link
Collaborator Author

@bolsinga bolsinga Jul 22, 2025

Choose a reason for hiding this comment

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

This should only ever be false when the user indicates they are finished searching (i.e. pressing the search button on the on-screen keyboard).

It looks like it's false only to get the full place details with every search, but in doing so, the results will actually be quite a bit worse on partial input (all of the input on mobile :P).

Ideally we'd fetch the details on selection. If that's not possible, lemme know and I've got some other ideas.

I don't have an async context to get the details once Search is pressed. So it cannot request the details then...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI, if it helps, the only detail missing is the lat/lng. The rest are superfluous for "I need a search destination".

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay in responding to this, but I just had a deeper look and it seems like, while there isn't a "swifty" async context, you can indeed do async operations (in this case, calling the place details endpoint with the selected item ID).

CarPlay executes your handler on the main queue. You must call the completion closure, or completionBlock in Objective-C, after you finish processing the selection. If you need to perform asynchronous tasks, dispatch them to a background queue and call the completion closure or completionBlock when they complete. CarPlay displays an asynchronous progress indicator until you call the completion closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants