سؤال

I'm looking for a way to display a UIAlert on the Iphone screen each time the Iphone goes to screenlock mode.

Is there a way to do that through local notifications without using timers ? Or any other means ? Is there a way to detect when screenlock is triggered ?

Thanks in advance ...

Miky Mike

هل كانت مفيدة؟

المحلول

There is no OS indication that the screen is about to lock, at least not that's available to valid apps.

The applicationWillEnterBackground method of your app delegate will be called if the user locks the screen or the device locks itself, but I don't believe you'll be able to display an alert from there.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top