Running a Timer in the background
问题 I'm writing an app in Swift where a timer counts down, much like a countdown clock. To do this I am using this code in my main logics class: func start() { self.timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { timer in self.run() } } Now every time I close the app, the timer stops and I get this error: BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Is there any way to continue the timer running in the background? Or do