如果显示 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
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚找到答案。它隐藏在这里:
当我显示 UIAlertView 时我可以收到消息
如果您监听“
UIWindowDidBecomeVisibleNotification
”通知,它也会触发您自己的警报,而不仅仅是系统警报。但是,对于您自己的警报,应用程序不会放弃激活。
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.