---
title: "init(timerInterval:countsDown:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/progressview/init(timerinterval:countsdown:)"
---

# init(timerInterval:countsDown:)

Creates a progress view for showing continuous progress as time passes.

## Declaration

```swift
nonisolated init(timerInterval: ClosedRange<Date>, countsDown: Bool = true)
```

## Parameters

- `timerInterval`: The date range over which the view progresses.
- `countsDown`: If true (the default), the view empties as time passes.

## Discussion

Discussion Use this initializer to create a view that shows continuous progress within a date range. The following example initializes a progress view with a range of start...end, where start is 30 seconds in the past and end is 90 seconds in the future. As a result, the progress view begins at 25 percent complete. struct ContentView: View {     let start = Date().addingTimeInterval(-30)     let end = Date().addingTimeInterval(90)

var body: some View {         ProgressView(timerInterval: start...end                      countsDown: false)     } }

By default, the progress view empties as time passes from the start of the date range to the end, but you can use the countsDown parameter to create a progress view that fills as time passes, as the above example demonstrates. The progress view provided by this initializer omits a descriptive label and provides a text label that automatically updates to describe the current time remaining. To provide custom views for these labels, use init(value:total:label:currentValueLabel:) instead. note: Date-relative progress views, such as those created with this initializer, don’t support custom styles.

## See Also

### Create a progress view spanning a date range

- [init(timerInterval:countsDown:label:)](swiftui/progressview/init(timerinterval:countsdown:label:).md)
- [init(timerInterval:countsDown:label:currentValueLabel:)](swiftui/progressview/init(timerinterval:countsdown:label:currentvaluelabel:).md)
