简体   繁体   English

如何使用iOS 5中的Storyboard功能自动执行segue?

[英]How to automate a segue using Storyboard feature in iOS 5?

I am trying to learn about Storyboards feature in iOS 5. I have this app that presents a EULA view with an accept button the first time it opens. 我正在尝试了解iOS 5中的Storyboards功能。我有这个应用程序,该应用程序在第一次打开时显示带有接受按钮的EULA视图。 The app remembers that the user accepted the EULA, and does not show it again. 该应用程序会记住用户接受了EULA,因此不会再次显示。 It shows another view (a tab bar view) as the first view from that point on. 从该点开始,它显示了另一个视图(标签栏视图)作为第一个视图。 Can this be accomplished with storyboards? 故事板可以完成吗? So far, I am only able to use a segue for user controlled actions. 到目前为止,我只能对用户控制的动作使用segue。 Where do I put the logic of checking the preferences to see if the user accepted the EULA and picking which UI View controller to show next, using one storyboard for the whole app? 我应该把检查首选项的逻辑放在哪里,以查看用户是否接受了EULA,并为整个应用使用一个故事板来选择下一个要显示的UI View控制器? Hope this is clear. 希望这很清楚。

thanks, 谢谢,

You can check your setting in your main view or in the app delegate using -application:didFinishLaunchingWithOptions . 您可以使用-application:didFinishLaunchingWithOptions在主视图或应用程序委托中检查设置。

Once you have decided which view to display, you can transition to that view using -performSegueWithIdentifier: . 确定要显示的视图后,可以使用-performSegueWithIdentifier:过渡到该视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM