How to show a loader in CarPlay Parking App

Is it possible to show a UIActivityIndicatorView or other loader class in a CarPlay Parking app?

I saw that one doesn't have access to the CPWindow in a Parking app -- only in navigation apps. So there doesn't seem to be a way to attach a subView to something.

I also went through the CPTemplates that are available to Parking apps searching for functions that might suggest that they would display a loader but couldn't find anything.

In the interface guidelines it mentions showing loaders in CarPlay apps. So I'm thinking there must be a way to do so. Unless this human interface guideline page only applies to navigation apps only.

Accepted Reply

All CarPlay Apps have access to the CPWindow in iOS 14. See Our WWDC20 Session for more information.

Replies

All CarPlay Apps have access to the CPWindow in iOS 14. See Our WWDC20 Session for more information.
I tried to access the CPWindow that is attached to templateApplicationScene inside the following callback:

Code Block
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController)


But the debugger consistently prints <uninitialized> when examining the object.
Here a gist that includes a screenshot to further illustrate this.

The description of the CPWindow also reads:

Navigation apps use a window to render their maps, and CarPlay provides one via the scene delegate’s templateApplicationScene(:didConnect:to:)method. For all other categories of apps, you use templates exclusively to draw your user interface, and your scene delegate must implement templateApplicationScene(:didConnect:)instead.

The app I'm working on is a CarPlay parking app.

Is the description of CPWindow not up to date? I'm using Xcode Version 12.0.1 (12A7300)
I watched the video but it doesn't make any reference to Window access or how to display a spinner in Templates like CPPointOfInterestTemplate. The only Template that seems to support spinners without requiring access to CPWindow is CPListTemplate (as shown in the video).
@sschmitt, did you find out any solution to this?

Looking into the documentation of CPTemplateApplicationSceneDelegate method,
templateApplicationScene(:didConnect:to:) says


@note This method is provided only for navigation apps; other apps should use the variant that does not provide a window.

So I am assuming CPWindow is not accessible for non-navigation Carplay apps. Which seems to contradict the official answer of ricob.

What are your thoughts on this?