iOS 5故事板,以编程方式确定路径 [英] iOS 5 storyboard, programmatically determine path

查看:79
本文介绍了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:


  1. 使用 UINavigationController 作为初始视图控制器。

  2. 创建一个将管理的根视图控制器决定加载什么。

  3. 从根视图控制器创建一个Storyboard Segues到主视图和设置视图,并为segue提供正确的标识符。

  4. 使用来自根视图控制器的正确标识符调用 performSegueWithIdentifier

  1. Use a UINavigationController as the initial view controller.
  2. Create a root view controller that will manage the decision of what to load.
  3. Create a Storyboard Segues from the root view controller to the main view and to settings view, and give the segues proper identifiers.
  4. Call the performSegueWithIdentifier with the proper identifier from your root view controller.

只是另一种解决方案,希望这会有所帮助。

Just another solution, hope this helps.

这篇关于iOS 5故事板,以编程方式确定路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆