本文介绍了延迟后运行的UIAlertAction处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将UIAlertViews更改为UIAlertControllers。我为它设置了这个动作:
I'm trying to change my UIAlertViews to UIAlertControllers. I set up this action for it:
UIAlertAction *undoStopAction = [UIAlertAction actionWithTitle:@"Undo Stop"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[self undoStop];
}];
但是,处理程序在点击操作后大约一秒钟才会运行。有什么方法可以加快速度吗?
But, the handler doesn't run until about a second after the action is tapped. Is there any way to speed this up?
推荐答案
警报视图的短暂延迟是正常的(不到一秒钟)。如果这对您不方便,您可以通过编程方式创建一个覆盖屏幕的视图,其中包含标签和按钮,基本上是一个自定义的警报视图。
The short delay is normal for Alert View (less than a second though). If this is not convenient for you, you can programmatically create a view that covers the screen with a label and a button, basically a customized alert view.
这篇关于延迟后运行的UIAlertAction处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!