iOS 8 - Swift - Xcode 6 Beta - 无界面构建器工作(没有笔尖,没有故事板) [英] iOS 8 - Swift - Xcode 6 Beta - working without interface builder (no nibs and no storyboard)

查看:98
本文介绍了iOS 8 - Swift - Xcode 6 Beta - 无界面构建器工作(没有笔尖,没有故事板)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在网络和Stackoverflow中搜索很多东西。不幸的是,新的Xcode版本似乎没有太多信息,iOS 8专门针对Swift而且没有Interface Builder。

I have been searching a lot in the inter webs and Stackoverflow. Unfortunately there doesn't seem to be much info around the new Xcode version, iOS 8 specifically with Swift and working without the Interface Builder.

可选择的模板起点现在没有选项以空应用程序开头。你拥有的设置最少的是采用单视图应用程序,它已经为你提供了ViewController和一个基本的故事板。

The Templates to choose from as a starting point now does not have the option to start with an empty application. The least setup you have is to take the single view application, which already gives you the ViewController and a basic Storyboard.

我讨厌故事板,我讨厌笔尖。我想在代码中做所有事情。我试图删除故事板文件,实例化窗口,设置rootViewController并让它像过去那样可见。 ViewController在没有nib和bundle的情况下进行初始化。

I hate storyboards and I hate nibs. I want to do everything in code. I tried to delete the storyboard file, instantiate the window, set the rootViewController and make it visible just like in the good old days. the ViewController initializes without nib and bundle.

结果这是一个带有此错误的SIGABRT:

The result is this a SIGABRT with this error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle </Users/[username]/Library/Developer/CoreSimulator/Devices/BC38B690-D30E-44FB-93B1-AB861D03B414/data/Containers/Bundle/Application/B6C160C8-67E1-4A74-9F81-55D097262050/blabla.app> (loaded)'

我确信我仍然可以在没有Interface Builder的情况下使用UI。任何人都知道如何进步?我记得我能够使用以前Beta版Xcode 6的空应用程序。

I sure hope that I will still be able to do UI without Interface Builder. Anyone has an idea on how to progress? I remember I was able to use an empty application with the previous Beta versions of Xcode 6.

推荐答案

在我看来 storyBoards 太棒了。它们使开发周期变得简单快捷。但如果您不想要它们,您可以创建单一视图应用程序模板。

In my opinion storyBoards are awesome. They make the development cycle easy and quick. But if you do not want them you can create a Single View Application template.


删除 storyBoard 并按照以下步骤操作

1)转到目标

2)部署信息

3)主界面 - >删除主要并保持字段为空

它不会加载故事板或任何视图。现在你有责任加载 Window 并创建 rootViewControllers 视图以编程方式

It will not load a storyboard or any view. Now it's your responsibility to load Window and create rootViewControllers and views programmatically

这篇关于iOS 8 - Swift - Xcode 6 Beta - 无界面构建器工作(没有笔尖,没有故事板)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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