Xcode 6 - 没有故事板的模板 [英] Xcode 6 - Template without Storyboards

查看:264
本文介绍了Xcode 6 - 没有故事板的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这听起来微不足道,但我对于测试版3/4的iOS应用程序缺乏'空'模板感到非常恼火。

I know this sounds trivial, but I'm quite irritated with the lack of an 'empty' template for iOS apps in beta 3/4.

我讨厌故事板方法,(IMO天真地认为它始终是最优雅的方法)。

I detest the Storyboard approach, (IMO it's naive to assume that it's always the most elegant approach).

事实上,对于我的大多数用例,故事板根本不起作用。

In fact for the majority of my use cases, Storyboards simply don't work.

任何人都可以告诉我如何在不使用SB的情况下获取空模板并进入起点(带窗口的应用代表)? - 或者将其他模板中的一个迁移到非SB。

Can anyone advise me on how I can take the empty template and get to a starting point (app delegate with a window) without SB's? - or migrate one of the other templates to non SB.

为segue方法做准备让我感到害怕它太丑了......

that prepare for segue method gives me shivers it's so ugly...

提前致谢。

推荐答案

我也不喜欢故事板。

以下是我从SB模板到代码设计中的干净利落的做法:

Here is what I do to go from a SB-template to nice and clean 'from code design':


  • 从单视图模板创建项目(给你最少的故事板'boilerplaite')

  • 删除故事板

  • go到您的AppDelegate(.m / .swift)并通过应用程序中的代码创建 UIWindow :didFinishLaunchingWithOptions:

  • create a project from the single-view template (gives you the least storyboard 'boilerplaite')
  • delete the Storyboard
  • go to your AppDelegate(.m / .swift) and create a UIWindow through code in application:didFinishLaunchingWithOptions::

CGRect screenBounds = [[UIScreen mainScreen] bounds];

UIWindow *window = [[UIWindow alloc] initWithFrame:screenBounds];

UIViewController *viewController = [[UIViewController alloc] init];
[window setRootViewController:viewController];

[window makeKeyAndVisible];

[self setWindow:window];


  • 记得选择你的目标并删除'General'下的'MainInterface'条目'部署信息'

  • remember to go select your target and delete the 'MainInterface' entry in 'General' under 'Deployment Info'

    从现在开始,您已经准备好了,Xcode不会让您烦恼不再:)

    From this point on, you are ready to go and Xcode won't annoy you with SB anymore :)

    不幸的是,到目前为止我还没有找到将项目保存为模板的方法:/

    Unfortunately, I haven't found a way to save a project as a template so far :/

    这篇关于Xcode 6 - 没有故事板的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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