大佬教程收集整理的这篇文章主要介绍了ios – LaunchScreen.storyboard无法打开Main.storyboard导航控制器,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
> LaunchScreen.storyboard只有我的启动画面的图像
>我有@L_49_1@main.storyboard,导航控制器连接到两个segues,Home和Registration.
>在ViewController.swift中,在viewDidLoad中我决定调用哪个segue
>我的Main.Storyboard没有rootViewController,我需要决定在运行时显示哪个viewController.
if (SetTings.hasRegistrationCompleted()) { performSegue(withIdentifier: "Home",sender: nil) } else { performSegue(withIdentifier: "Registration",sender: nil) }
我的问题
>如果(SetTings.has和断点永远不会到达此处),我会在第一行放置一个断点
> LaunchScreen仅持续2秒(在我的模拟器上测试)如何增加它
编辑
我将Main设置为我项目的主界面.我做了一个Clean build并再次尝试,但没有工作.
以下是Main.Storyboard
第一
检查您的故事板@L_387_13@main.storyboard是否正确附加在您的目标中 – >一般 – >部署信息 – >主接口,例如像这样
第二
检查与导航控制器连接的初始VC并确保初始VC为根控制器
更新答案
最初为每个VC设置Stroryboard ID
在appdelegate中更改Root控制器之后
func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { self.window = UIWindow(frame: UIScreen.main.bounds) // Override point for customization after application launch. let storyboard = UIStoryboard(name: "Main",bundle: nil) let rootViewController: UIViewController? if (SetTings.hasRegistrationCompleted()) { rootViewController = storyboard.instantiateViewController(withIdentifier: "HomeVC") }else { rootViewController = storyboard.instantiateViewController(withIdentifier: "RegistrationVC") } let navigation = UINavigationController(rootViewController: rootViewController!) self.window?.rootViewController = navigation self.window?.makeKeyAndVisible() return true }
以上是大佬教程为你收集整理的ios – LaunchScreen.storyboard无法打开Main.storyboard导航控制器全部内容,希望文章能够帮你解决ios – LaunchScreen.storyboard无法打开Main.storyboard导航控制器所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。