How To Make a Simple Countdown Timer with SwiftUI

Step-by-step instructions on how to build using the SwiftUI framework

Antoine Barrault
Jun 4 · 2 min read

Pre-Requirements


Creating a SwiftUI project

var body: some View {    Text("Hello World")}

Making the Timer Logic


Adding Countdown Logic Inside the Label

var body: some View {
Text(countDownString(from: referenceDate, until: date))
}

Making the Timer Fire


The Complete Code

Better Programming

Advice for programmers.

Antoine Barrault

Written by

I write Swift code. Dad of two awesome children with a wonderful wife.

Better Programming

Advice for programmers.