Does this help?
struct ContentView: View {
@State private var timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()
@State private var count = 59
var body: some View {
Text(count < 10 ? "00:0\(count)" : "00:\(count)")
.onReceive(timer) { time in
count -= 1
print(count)
if count == -1 {
count = 59
}
}
}
}