如果显示UIAlertView,是否在iOS上有通知? [英] Is there a notification on iOS if a UIAlertView is shown?

查看:123
本文介绍了如果显示UIAlertView,是否在iOS上有通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道如果弹出 UIAlertView ,是否有通知可用?
背景:我的应用程序会在一段时间不活动后要求用户输入PIN,但如果屏幕上出现警报,我想阻止它。
我不想通过我的代码查找所有警报并禁用PIN检查器,而是通知会很棒。希望 NSNotification

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?

推荐答案

刚刚找到答案。它隐藏在这里:

Just found the answer. It is hidden in here:

我可以在显示UIAlertView时收到消息

如果您收听 UIWindowDidBecomeVisibleNotification 通知,它还会触发您自己的警报,而不仅仅是系统警报。
对于您自己的警报,该应用程序不会重新激活激活。

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.

这篇关于如果显示UIAlertView,是否在iOS上有通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆