<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPTabBarTemplateDelegate/tabBarTemplate(_:didSelect:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(pl)CPTabBarTemplateDelegate(im)tabBarTemplate:didSelectTemplate:"
  },
  "title" : "tabBarTemplate(_:didSelect:)"
}
-->

# tabBarTemplate(_:didSelect:)

Tells the delegate when the tab bar selects the specified template.

```
func tabBarTemplate(_ tabBarTemplate: CPTabBarTemplate, didSelect selectedTemplate: CPTemplate)
```

## Parameters

`tabBarTemplate`

The tab bar template that alerts you to the change in selection.

`selectedTemplate`

The template that the user selects.

## Discussion

The tab bar template calls this method each time the user selects a tab. `tabBarTemplate` is the same template that the tab bar’s [`selectedTemplate`](/documentation/CarPlay/CPTabBarTemplate/selectedTemplate) property returns.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)