UIAlertAction的处理程序为时已晚-如何使其立即生效? [英] The handler of a UIAlertAction is a bit too late - how can I make it immediate?

查看:134
本文介绍了UIAlertAction的处理程序为时已晚-如何使其立即生效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试(...)向添加到UIAlertController的按钮添加声音效果.我在处理程序中发出了声音效果,但这实际上为时已晚.声音触发时间大约为0.5秒.我希望在警报即将消失时发出声音,而不是在声音消失后 发出声音.使用UIAlertView,可以使用alertWillDismiss ...而不是alertDidDismiss来处理.

I am trying (...) to add a sound effect to the buttons added to a UIAlertController. I fire a sound effect in the handler, but this actually is a bit too late. The sound fires like 0.5 seconds too late. I want the sound to fire as soon as the alert is about to dismiss, not after it has dismissed. With UIAlertView this was possible to handle using alertWillDismiss... rather than alertDidDismiss.

我错过了什么吗?

推荐答案

不,您什么都没错过.您正在寻找的功能不是由UIAlertController提供的.考虑提供自己的呈现视图控制器,通过它您将获得所需的精细控制.

No, you didn't miss anything. The functionality you're looking for is not provided by UIAlertController. Consider providing your own presented view controller, over which you'll have the kind of fine control you're after.

这篇关于UIAlertAction的处理程序为时已晚-如何使其立即生效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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