79709659

Date: 2025-07-21 21:41:25
Score: 2
Natty:
Report link

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
                }
            }
    }
}
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: user17852191