IPhone lock screen notification for app

How can I get a notification that the screen / phone was locked while my application was running? I want to pause some timers related to updating the display in such cases.

+3
source share
1 answer

I think your UIApplicationDelegate will receive the following message before the screen locks:

- (void)applicationWillResignActive:(UIApplication *)application

here's a link to the documentation: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive :

+3
source

Source: https://habr.com/ru/post/1741399/


All Articles