Class

CPNavigationAlert

An alert that displays map- or navigation-related information to the user.

Declaration

@interface CPNavigationAlert : NSObject

Overview

To display a navigation alert, create an instance of CPNavigationAlert and pass it to the map template’s presentNavigationAlert: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 dismissNavigationAlertAnimated:completion:.

Topics

Creating a Navigation Alert

Getting Titles

titleVariants

An array of title strings.

subtitleVariants

An array of subtitle strings.

- updateTitleVariants:subtitleVariants:

Updates title and subtitle variants.

Getting the Alert Image

imageSet

An image set displayed in the navigation alert.

Getting the Actions

primaryAction

The primary action, and button, for the navigation alert.

secondaryAction

An optional secondary action, and button, for the navigation alert.

Getting the Alert Duration

duration

The amount of time, in seconds, that the alert is visible.

CPNavigationAlertMinimumDuration

A constant that defines the minimum amount of time that an alert is visible.

Instance Properties

image

An image displayed in the navigation alert.

Beta

Relationships

Inherits From

Conforms To

See Also

Displaying a Navigation Alert

- presentNavigationAlert:animated:

Displays a navigation alert on the map template.

- dismissNavigationAlertAnimated:completion:

Tells the map template to dismiss the visable navigation alert.

currentNavigationAlert

The visible navigation alert.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software