Consider the following code on iOS:
struct ContentView: View {
@State private var timerInterval = Date(timeIntervalSince1970: 0) ... Date(timeIntervalSince1970: 0)
var body: some View {
VStack {
ProgressView(
timerInterval: timerInterval,
countsDown: true
)
Button {
let now = Date()
let then = now.addingTimeInterval(5)
timerInterval = now ... then
} label: {
Text("Start")
}
}
.padding()
}
}
When I tap on the Start button, the progress view starts animating as expected, and its label is displaying the remaining time.
However, at the very end, when the countdown reaches zero, the blue bar of the progress view doesn't reach zero and still has some progress left forever.
Is this the expected behavior or a bug? Is there a way to make the bar reach zero without implementing my own custom view?
Thanks in advance!