Is there a notification on iOS if a UIAlertView is shown?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 03:35:45

问题


Wondering if there is a notification available if a UIAlertView pops up? Background: my app asks the user for a PIN after a period of inactivity but I would like to prevent it if an alert is on screen. I don't want to go through my code and find all alerts and disable the PIN checker, instead a notification would be awesome. Any hope with NSNotification?


回答1:


Just found the answer. It is hidden in here:

Can I get message when I show UIAlertView

If you listen to the "UIWindowDidBecomeVisibleNotification" notification, it will also fire for your own alerts, not only for system alerts. For your own alerts, the application does not resign activiation however.



来源:https://stackoverflow.com/questions/7692205/is-there-a-notification-on-ios-if-a-uialertview-is-shown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!