ios - 如何在 3 秒后显示新的视图控制器
问题描述
单击按钮后,我想显示一个新的 ViewController,但不是直接显示。单击按钮后,我想等待 3 秒,然后在 3 秒后我想要新的 ViewController
解决方案
在单击按钮时添加延迟:
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
// Your code with navigate to another controller
}
推荐阅读
- salesforce - maps.API.Geocode - '您有未提交的工作待处理。请在调用之前提交或回滚'
- android - Kivy/KivyMD 应用程序在编译为 .apk 后在 Android 上崩溃
- android-studio - 如何在 Android Studio 中将信息从一台设备发送到另一台设备?
- java - 如何正确实现开闭原则?
- django - 带有 Tailwind CSS 的 Django-Tinymce
- android - 带有 Kotlin 的 Android Studio 没有使用 Fuel ajax 更新 textView.text
- java - Java 商店库存
- html - 如何从 bash 中的字符串中删除 HTML?
- python - Python:根据条件聚合数据帧值,具体取决于系列总和
- python - 为什么即使没有显式导入子模块名称,也可以在 __init__.py 中访问它们?