ios - 如何在用户无法看到呈现 View 的情况下使用已经呈现的模态视图 Controller 启动 iOS 应用程序?

标签 ios objective-c modal-dialog launch presentmodalviewcontroller

我已经尝试了很多组合,从应用委托(delegate)、呈现 View Controller 的 viewDidLoad 执行此操作,有延迟和没有延迟,有和没有动画。

但是要么用户可以暂时看到呈现的 View Controller ,要么模态框不会呈现。

如何实现?

最佳答案

使用 Storyboard尝试了以下代码,应用程序以模态视图 Controller 启动:

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self.window makeKeyAndVisible];
    [self.window.rootViewController performSegueWithIdentifier:@"modalSegue" sender:self];

    return YES;
}

从开始 View Controller 到模态视图 Controller 的 Segue 配置:

enter image description here

关于ios - 如何在用户无法看到呈现 View 的情况下使用已经呈现的模态视图 Controller 启动 iOS 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19480150/

相关文章:

ios - 我怎样才能得到没有分隔符的格式化小时字符串?

modal-dialog - Foundation 5 - 显示模态的顶部位置

html - Bootstrap 模式失焦

ios - 为什么带行距的多行 UILabel 会删除末尾的 3 个点?

ios - 从详细 View Controller 返回时停止嵌入式 TableView 单元格中的 activityIndi​​cator

iphone - 在 iPhone 中播放透明的 MOV 文件

java - 更改浏览器选项卡时,从 Applet 打开的模型对话框位于 Applet 后面

ios - 通用应用程序 : LaunchScreen not respecting interface builder constraint when launching in landscape

objective-c - 静态库依赖的最佳实践

ios - 在没有通知服务扩展的情况下显示推送通知角标(Badge)