MagicTimer icon indicating copy to clipboard operation
MagicTimer copied to clipboard

About countdown

Open Monkey-X-Byte opened this issue 1 year ago • 0 comments

There is an error in the countdown time return, and it does not stop when the time reaches completion。

func start() {
        timer.countMode = .countDown(fromSeconds: 60)
        timer.defultValue = 0
        timer.effectiveValue = 1
        timer.timeInterval = 1
        timer.isActiveInBackground = true

        // Set up event handlers
        timer.lastStateDidChangeHandler = { state in
            print("Timer state changed: \(state)")
        }

        timer.elapsedTimeDidChangeHandler = { elapsedTime in
            print("Elapsed time updated: \(elapsedTime)")
        }

        // Start the timer
        timer.start()
    }

Monkey-X-Byte avatar Jul 18 '23 01:07 Monkey-X-Byte