---
title: "init(preAlert:postAlert:)"
framework: alarmkit
role: symbol
role_heading: Initializer
path: "alarmkit/alarm/countdownduration-swift.struct/init(prealert:postalert:)"
---

# init(preAlert:postAlert:)

Creates an instance of a countdown duration.

## Declaration

```swift
init(preAlert: TimeInterval?, postAlert: TimeInterval?)
```

## Parameters

- `preAlert`: The duration applied before the alarm fires.
- `postAlert`: The duration applied after the alarm has alerted at least once and moves back to the countdown state.

## See Also

### Creating a countdown duration

- [postAlert](alarmkit/alarm/countdownduration-swift.struct/postalert.md)
- [preAlert](alarmkit/alarm/countdownduration-swift.struct/prealert.md)
