ios - 延迟后运行的 UIAlertAction 处理程序

标签 ios objective-c uialertview uialertcontroller uialertaction

我正在尝试将我的 UIAlertViews 更改为 UIAlertControllers。我为它设置了这个 Action :

UIAlertAction *undoStopAction = [UIAlertAction actionWithTitle:@"Undo Stop"
                                                        style:UIAlertActionStyleDefault
                                                       handler:^(UIAlertAction *action) {
                                                           [self undoStop];
                                                       }];

但是,处理程序直到操作被点击后大约一秒钟才会运行。有什么办法可以加快速度吗?

最佳答案

警报 View 的短暂延迟是正常的(不过不到一秒)。如果这对您来说不方便,您可以通过编程方式创建一个用标签和按钮覆盖屏幕的 View ,基本上是自定义警报 View 。

关于ios - 延迟后运行的 UIAlertAction 处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32441856/

相关文章:

ios - 取消 NSOperation 完成 block

android - 如何将 Cordova 应用链接到 App Store?

ios - 数组中的 Swift 不同类型的泛型

ios - 更改警报 View 可见时按主页按钮的默认行为

objective-c - 如何在 objective-c 中给出 toast 信息

iphone - UIAlertView 在未记录的方法上崩溃

ios - 如何在 Firestore 中构建搜索列表?

ios - 在代码中将变量保存到 CoreData 实体 - Objective-C/XCode

objective-c - 如何在 ios 开发中从 mp3 文件中提取元数据

objective-c - UIAlertView cancelButtonTitle