<!--
{
  "availability" : [
    "iOS: 12.0.0 - 13.0.0",
    "iPadOS: 12.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPNavigationAlert/init(titleVariants:subtitleVariants:imageSet:primaryAction:secondaryAction:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPNavigationAlert(im)initWithTitleVariants:subtitleVariants:imageSet:primaryAction:secondaryAction:duration:"
  },
  "title" : "init(titleVariants:subtitleVariants:imageSet:primaryAction:secondaryAction:duration:)"
}
-->

# init(titleVariants:subtitleVariants:imageSet:primaryAction:secondaryAction:duration:)

Creates a navigation alert.

```
init(titleVariants: [String], subtitleVariants: [String]?, imageSet: CPImageSet?, primaryAction: CPAlertAction, secondaryAction: CPAlertAction?, duration: TimeInterval)
```

## Parameters

`titleVariants`

An array of localized, displayable titles. The system selects the title that fits in the available display space.

`subtitleVariants`

An array of localized, displayable subtitles. The system selects the title that fits in the available display space.

`imageSet`

An image set displayed in the navigation alert. The navigation alert doesn’t support animated images. If you provide an animated image, the alert uses the first image in the animation sequence.

`primaryAction`

The primary action and its button.

`secondaryAction`

An optional, secondary action with its button.

`duration`

The amount of time, in seconds, that the alert is visible. Setting the duration to 0 displays the alert until dismissed by the user.

## Return Value

A newly initialized navigation alert.

---

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)