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

# init(warning:)

Creates additional route information for route warnings.

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

## Return Value

A new @c CPRouteDetail instance representing a route warning

## 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.

\discussion 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.

---

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)