One Logo Pool Ball
AlarmKit · IOS API REFERENCE

Alarm

struct · iOS 26.0+ · SDK 27.1

struct Alarm

An object that describes an alarm that can alert once or on a repeating schedule. The following is an example of a 10 second timer: ``` swift let configuration = AlarmManager.AlarmConfiguration( countdownDuration: Alarm.CountdownDuration(preAlert: 10, postAlert: 10), schedule: nil, attributes: attributes, secondaryIntent: repeatIntent, sound: .default) ``` The following is an example of an alarm that includes a 9 minute snooze option and plays the default sound: ``` swift let configuration = AlarmManager.AlarmConfiguration( countdownDuration: Alarm.CountdownDuration(preAlert: nil, postAlert: 9 * 60), schedule: .relative(schedule), attributes: attributes, secondaryIntent: snoozeIntent, sound: .default) ```

Members (8)

get · iOS 26.0+

countdownDuration

TypeScript
get countdownDuration(): (Alarm_CountdownDuration) | null
Swift declaration
var countdownDuration: Alarm.CountdownDuration?

The time left before an alert, in seconds. When set to a non-nil value, the system shows the countdown in the Lock Screen for the specified duration. The UI will appear at a time equal to the next scheduled alert date minus the duration.

set · iOS 26.0+

countdownDuration

TypeScript
set countdownDuration(value: (Alarm_CountdownDuration) | null)
Swift declaration
var countdownDuration: Alarm.CountdownDuration?

The time left before an alert, in seconds. When set to a non-nil value, the system shows the countdown in the Lock Screen for the specified duration. The UI will appear at a time equal to the next scheduled alert date minus the duration.

get · iOS 26.0+

id

TypeScript
get id(): string
Swift declaration
var id: UUID

The unique identifier of the alarm.

set · iOS 26.0+

id

TypeScript
set id(value: string)
Swift declaration
var id: UUID

The unique identifier of the alarm.

get · iOS 26.0+

state

TypeScript
get state(): Alarm_State
Swift declaration
var state: Alarm.State

The current state of the alarm. This is a snapshot of the state captured when the alarm was fetched from the daemon. It won't update if the state changes on the daemon.

set · iOS 26.0+

state

TypeScript
set state(value: Alarm_State)
Swift declaration
var state: Alarm.State

The current state of the alarm. This is a snapshot of the state captured when the alarm was fetched from the daemon. It won't update if the state changes on the daemon.

get · iOS 26.0+

schedule

TypeScript
get schedule(): (Alarm_Schedule) | null
Swift declaration
var schedule: Alarm.Schedule?

The schedule determines when the alarm alerts. If no schedule is supplied then the alarm will begin counting down immediately.

set · iOS 26.0+

schedule

TypeScript
set schedule(value: (Alarm_Schedule) | null)
Swift declaration
var schedule: Alarm.Schedule?

The schedule determines when the alarm alerts. If no schedule is supplied then the alarm will begin counting down immediately.

Skipped declarations

No declarations were skipped in this snapshot.

All AlarmKit types →