One Logo Pool Ball
AlarmKit · IOS API REFERENCE

AlarmPresentation.Alert

struct · iOS 26.0+ · SDK 27.1

struct Alert

An object that describes the UI of the alert that appears when an alarm fires. `Alert` configures the title and buttons in the alarm UI. The system provides a stop button automatically. Use this object to optionally define a secondary button and its behavior. The code snippet below describes how to configure an `Alert` with a secondary button. ```swift let alert = AlarmPresentation.Alert( title: "Eggs are ready!", secondaryButton: AlarmButton(text: "Repeat", textColor: .blue, systemImageName: "repeat"), secondaryButtonBehavior: .countdown) ```

Members (10)

get · iOS 26.0+

stopButton

TypeScript
get stopButton(): AlarmButton
Swift declaration
var stopButton: AlarmButton { get set }

The appearance of the stop button.

set · iOS 26.0+

stopButton

TypeScript
set stopButton(value: AlarmButton)
Swift declaration
var stopButton: AlarmButton { get set }

The appearance of the stop button.

get · iOS 26.0+

secondaryButton

TypeScript
get secondaryButton(): (AlarmButton) | null
Swift declaration
var secondaryButton: AlarmButton?

The appearance of the secondary button. If you use `nil`, the secondary button is omitted.

set · iOS 26.0+

secondaryButton

TypeScript
set secondaryButton(value: (AlarmButton) | null)
Swift declaration
var secondaryButton: AlarmButton?

The appearance of the secondary button. If you use `nil`, the secondary button is omitted.

get · iOS 26.0+

secondaryButtonBehavior

TypeScript
get secondaryButtonBehavior(): (AlarmPresentation_Alert_SecondaryButtonBehavior) | null
Swift declaration
var secondaryButtonBehavior: AlarmPresentation.Alert.SecondaryButtonBehavior?

The defined behavior of the second button. You can define the button to switch back to a countdown for a snoozed alarm or repeating timer, or execute an intent without mutating the alarm state.

set · iOS 26.0+

secondaryButtonBehavior

TypeScript
set secondaryButtonBehavior(value: (AlarmPresentation_Alert_SecondaryButtonBehavior) | null)
Swift declaration
var secondaryButtonBehavior: AlarmPresentation.Alert.SecondaryButtonBehavior?

The defined behavior of the second button. You can define the button to switch back to a countdown for a snoozed alarm or repeating timer, or execute an intent without mutating the alarm state.

get · iOS 26.0+

title

TypeScript
get title(): _Foundation_LocalizedStringResource
Swift declaration
var title: LocalizedStringResource

The title of the alert.

set · iOS 26.0+

title

TypeScript
set title(value: _Foundation_LocalizedStringResource)
Swift declaration
var title: LocalizedStringResource

The title of the alert.

init · iOS 26.0+ · Deprecated in iOS 26.1

init

TypeScript
static initTitleStopButtonSecondaryButtonSecondaryButtonBehavior(title: _Foundation_LocalizedStringResource, stopButton: AlarmButton, secondaryButton?: (AlarmButton) | null, secondaryButtonBehavior?: (AlarmPresentation_Alert_SecondaryButtonBehavior) | null): AlarmPresentation_Alert
Swift declaration
init(title: LocalizedStringResource, stopButton: AlarmButton, secondaryButton: AlarmButton? = nil, secondaryButtonBehavior: AlarmPresentation.Alert.SecondaryButtonBehavior? = nil)

Creates an alert for an alarm. - Parameters: - title: The title of the alert. - stopButton: The end button for an alarm. - secondaryButton: The customizable second button for an alarm. - secondaryButtonBehavior: The defined behavior of the secondary button.

init · iOS 26.1+

init

TypeScript
static initTitleSecondaryButtonSecondaryButtonBehavior(title: _Foundation_LocalizedStringResource, secondaryButton?: (AlarmButton) | null, secondaryButtonBehavior?: (AlarmPresentation_Alert_SecondaryButtonBehavior) | null): AlarmPresentation_Alert
Swift declaration
init(title: LocalizedStringResource, secondaryButton: AlarmButton? = nil, secondaryButtonBehavior: AlarmPresentation.Alert.SecondaryButtonBehavior? = nil)

Creates an alert for an alarm, with a system-provided stop control and optionally a second button. - Parameters: - title: The title of the alert. - secondaryButton: The customizable second button for an alarm. - secondaryButtonBehavior: The defined behavior of the secondary button.

Skipped declarations

No declarations were skipped in this snapshot.

All AlarmKit types →