I was trying to follow a SwiftUI tutorial and build a simple stopwatch app.
I have a Text view that displays the time by calling
Code Block class TimeBreakdown: ObservableObject { @Published var hours = 0 @Published var minutes = 0 @Published var secondsElapsed = 0 } class StopwatchManager: ObservableObject { @Published var mode: StopwatchMode = .stopped var timer = Timer() @ObservedObject var timeKeeper = TimeBreakdown()
I have a Text view that displays the time by calling
Code Block stopwatch.timekeeper.hours
and so on. However, it isn't updating the view right now after the timer starts running and I was wondering how I can fix that