0

Do you know how I can pause (or stop) my timer when my app stop and disappear due to call mobile reception ?

is it method in AppDelegate ?

Thanks

Baptiste
  • 19
  • 1
  • See https://stackoverflow.com/questions/34744783/detect-ios-app-entering-background to have your view controller with the timer know when the app becomes inactive. Also register to know when the app becomes active again. – rmaddy Apr 17 '19 at 16:16

1 Answers1

1

You can subscribe to the willResignActiveNotification notification in NotificationCenter and run code when that happens. You can read up on it here.

rpecka
  • 1,168
  • 5
  • 17