A template that provides a navigation bar and map buttons allowing users to interact with your app.
- iOS 12.0+
After the system calls your app delegate’s
application(_: method, create a
CPMap object, and set it as the root template for your interface controller by calling
The map template appears as an overlay on top of the base view. The template is the control layer, providing a navigation bar and map buttons that users interact with through the CarPlay screen.
When the user begins to interact with your app through the CarPlay screen, the system displays the navigation bar, hiding it after a brief period of inactivity. You can change this behavior by setting the
The navigation bar includes up to two leading and two trailing buttons. You can change the buttons, including their title and icon image, by setting the
trailing properties on your template.
Also, you can display additional map buttons by providing an array of
CPMap objects to
map. Use these buttons to provide users access to actions such as entering panning mode or zooming in and out on the map.