CPNavigationAlert
An alert that displays map- or navigation-related information to the user.
Declaration
@MainActor class CPNavigationAlertOverview
To display a navigation alert, create an instance of CPNavigationAlert and pass it to the map template’s present(navigationAlert:animated:) method. When creating an alert, you must provide a title, action, and duration. The duration tells the system how long to show the alert before automatically dismissing it. You can also include a subtitle and secondary action when needed.
The system displays the primary and secondary actions as buttons on the alert. After the user taps the button, the system calls the action’s handler block, which is where your app performs the requested action. The system also dismisses the alert after the user taps the button. However, your app can dismiss the alert without any user interaction by calling dismissNavigationAlert(animated:completion:).
Topics
Creating a Navigation Alert
init(titleVariants:subtitleVariants:image:primaryAction:secondaryAction:duration:)init(titleVariants:subtitleVariants:imageSet:primaryAction:secondaryAction:duration:)