---
title: "init(warning:)"
framework: carplay
role: symbol
role_heading: Initializer
path: "carplay/cproutedetail/init(warning:)"
---

# init(warning:)

Creates additional route information for route warnings.

## Declaration

```swift
convenience init(warning: String)
```

## Return Value

Return Value A new @c CPRouteDetail instance representing a route warning

## Discussion

Discussion Use this method to display important warnings or alerts about conditions along the route. This helps users prepare for challenging or hazardous conditions they may encounter. Warnings draw attention to significant issues that may affect route safety or accessibility. Use this for critical information that users should be aware of before selecting a route. note: Reserve warnings for significant conditions. Use the tintColor property to set an appropriate color (such as red or orange) to ensure warnings are visually prominent. Consider localizing warning messages for international users.
