---
title: "templateApplicationScene(_:didConnect:to:)"
framework: carplay
role: symbol
role_heading: Instance Method
path: "carplay/cptemplateapplicationscenedelegate/templateapplicationscene(_:didconnect:to:)"
---

# templateApplicationScene(_:didConnect:to:)

Tells the delegate about the addition of a CarPlay scene to your navigation app.

## Declaration

```swift
optional func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController, to window: CPWindow)
```

## Parameters

- `templateApplicationScene`: The scene connecting to the app.
- `interfaceController`: The interface controller for managing the user interface of this scene.
- `window`: The window where the app draws the map content.

## Mentioned in

Displaying Content in CarPlay

## Discussion

Discussion CarPlay calls this method when it launches your navigation app and connects the scene. Create an instance of your map-drawing view controller and assign it to the window’s root view controller. Use the interface controller to present your user interface templates. You must set both the window’s root view controller and the scene’s root template before returning from this method. important: CarPlay calls this method exclusively for navigation apps. All other categories of apps must implement templateApplicationScene(_:didConnect:) instead.

## See Also

### Responding to the Scene Life Cycle

- [templateApplicationScene(_:didConnect:)](carplay/cptemplateapplicationscenedelegate/templateapplicationscene(_:didconnect:).md)
- [templateApplicationScene(_:didDisconnectInterfaceController:)](carplay/cptemplateapplicationscenedelegate/templateapplicationscene(_:diddisconnectinterfacecontroller:).md)
- [templateApplicationScene(_:didDisconnect:from:)](carplay/cptemplateapplicationscenedelegate/templateapplicationscene(_:diddisconnect:from:).md)
