22
Jan
2021
Timers and countdowns in SwiftUI
Reading time: 1 min
This recipe shows how to implement a timer in SwiftUI in order to update the UI state at a specific interval.
There are two ways of going about it:
- The simple one, with
onReceive
. - A bit more complex, but also more powerful one, using
SimpleTimer
wrapper.