I am using NSTimer for a timing app. The timer pushes an update to the timer which is sitting in the system bar at the top of the screen.
One of my users noticed something strange that when they are running another app in full screen- then the timer seems to lose 10% of the time. But if the other app is not in full screen- then its totally bang on right time.
Is there a flaw with my approach:
the following method is triggered by the timer function:
@objc func update() {
currentTime += 1
updateMenuTimer()
}
private func updateMenuTimer() {
guard let timeString = currentTimeString else { return }
appDel?.updateMenuTimer(newTime: timeString)
}
// In AppDelegate I manage the status bar view
func updateMenuTimer(newTime: String) {
statusItem.button?.title = newTime
}