iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以编程方式确定路径)
问题描述
我无法使用情节提要实现以下目标:
I'm having trouble to achieve the following using a storyboard:
设置未完成时:运行应用程序 -> 显示设置视图控制器 -> 显示主导航控制器设置完成后:运行应用程序 -> 显示主导航控制器
When setup is not done: run app -> show settings view controller -> show main navigation controller When setup is done: run app -> show main navigation controller
所以基本上,我希望应用程序在某些情况下以编程方式从设置视图开始,否则直接跳到主导航控制器.
So basically, I want the app to programmatically start with the settings view in certain cases, and otherwise skip right ahead to the main navigation controller.
我确实设法通过主导航控制器的模态样式segue 显示设置视图,但我不知道如何在主导航控制器显示之前显示它.有什么想法吗?
I did manage to show the settings view with a modal style segue from the main navigation controller, but I don't know how to display it before the main navigation controller is displayed. Any ideas?
推荐答案
我设法做到了一点不同:
I managed to do it a bit different:
- 使用
UINavigationController作为初始视图控制器. - 创建一个根视图控制器来管理加载内容的决定.
- 创建从根视图控制器到主视图和设置视图的 Storyboard Segue,并为这些 segue 提供适当的标识符.
- 使用根视图控制器中的正确标识符调用
performSegueWithIdentifier.
- Use a
UINavigationControlleras the initial view controller. - Create a root view controller that will manage the decision of what to load.
- Create a Storyboard Segues from the root view controller to the main view and to settings view, and give the segues proper identifiers.
- Call the
performSegueWithIdentifierwith the proper identifier from your root view controller.
只是另一种解决方案,希望对您有所帮助.
Just another solution, hope this helps.
这篇关于iOS 5 故事板,以编程方式确定路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS 5 故事板,以编程方式确定路径
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
