CPNowPlayingTemplateObserver
The methods for responding to the user interacting with the Now Playing template.
Declaration
protocol CPNowPlayingTemplateObserver : NSObjectProtocolOverview
You use a Now Playing template observer to respond when the user interacts with the Album-Artist and Up Next buttons. The protocol defines methods that CarPlay calls when a user taps these buttons. Use your implementation to provide the appropriate behavior when these events occur. For example, when the user taps the Album-Artist button, you can present a new template that displays the content of the current album, playlist, or podcast.
To register an observer, create an object that implements the CPNowPlayingTemplateObserver protocol and then call the Now Playing template’s add(_:) method, passing your object as the only parameter.