I am creating an application for my school that should check every n minutes if there is a new tag on the website. To do this the first time a user logs in, the actual label number is stored in "UserDefaults". When the application is completed, after n minutes the number of characters is recounted and compared with the previous one, and sends a notification in case of a change in the number.
What I would like to know is there a way to accomplish this task. I tried to create a timer in -applicationWillTerminate, but it only started once. This is what I tried:
func applicationWillTerminate(_ application: UIApplication) { DispatchQueue.main.async { self.timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(AppDelegate.findMark), userInfo: nil, repeats: true) self.timer.fire() } }
The task of SelectMarkMark is the task.
Thanks in advance!
source share