Good day. I correctly understood that through NSUserDefaults you can not save the timer when the application is not active? When you close the application and then open it, my timerLabel shows the time at which the application exited, and when you start it again, the timer just keeps going from the moment it stopped.
- explain what you need to do - Max Mikheyenko
- I need the timer for 30 minutes to go when the application is not active. - Spartak
- Just to go or so that when the application is inactive, the alarm clock will also work or something like that? - Max Mikheyenko
- My life is restored in 30 minutes. 1 life is restored every 30 minutes. Everything works, but only when the application is active. - Spartak
- remember the time when one life was added, and set the timer for 30 minutes. If the application is closed and reopened, see how much time has passed and add the required number of lives. FOR EXAMPLE: if when opening an application it turns out that 75 minutes have passed since the last addition - add 2 lives and set the timer for 15 minutes, and save again the time when life was added last time - 15 minutes ago. - Max Mikheyenko
|