<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPRouteDetail/init(trafficLights:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPRouteDetail(cm)routeDetailWithTrafficLights:"
  },
  "title" : "init(trafficLights:)"
}
-->

# init(trafficLights:)

Creates additional route information for the number of traffic lights along the route.

```
convenience init(trafficLights: Int)
```

## Parameters

`trafficLights`

The number of traffic lights along the route. Common values range from 0 to 50+
for typical urban routes.

## Return Value

A new @c CPRouteDetail instance representing the traffic light count

## Discussion

Use this method to display the count of traffic signals that will be encountered along the route.
This helps users understand potential stop-and-go traffic patterns and estimate realistic travel time.

\discussion Traffic light count provides valuable context for route selection, especially in urban
areas where signal timing can significantly impact travel time. Routes with fewer traffic lights
may offer smoother travel despite similar distances.
\note The count should include all signalized intersections where the route requires stopping or
yielding. Consider excluding traffic lights on cross streets that don’t affect the route.
This information pairs well with travel time estimates to help users understand route flow.

---

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)