IOS 8 - Swift - Xcode 6 Beta - works without creating an interface (no pens and no storyboard)

I have searched a lot on the internet and Stackoverflow. Unfortunately, there is not much information on the new version of Xcode, iOS 8, specifically with Swift and without the Interface Builder.

Templates for starting point selection no longer have the ability to start from an empty application. The smallest setup you have is to take a single viewer app, which already gives you a ViewController and a basic storyboard.

I hate storyboards and I hate feathers. I want to do everything in code. I tried deleting the storyboard file, instantiating the window, installing the rootViewController and making it visible like the good old days. The ViewController is initialized with no tip and no beam.

The result is 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)'

      

Hope I can make UI without Builder interface. Anyone have an idea on how to progress? I remember that I could use a blank app with previous beta versions of Xcode 6.

+3


source to share


2 answers


In my opinion, they storyBoards

are amazing. They make the development cycle simple and fast. But if you don't want them, you can create a template Single View Application

.

Uninstall storyBoard

and follow these steps.

1) Go to your goal

2) Deployment information

3) Main interface -> Delete main and keep the field blank



enter image description here

It won't load a storyboard or any presentation. It is now your responsibility to download Window

and create rootViewControllers

and views

programmatically

+1


source


The method described by the code is a good solution, but (in Xcode 6.0.1) the last step - removing "Main" from the Main Interface section - won't work for me; I would remove the line, but as soon as I sail away from this page or try to launch the application, the field will be populated with "Main". I had to manually delete the "UIMainStoryboardFile" key / value entry in Info.plist applications.



+1


source







All Articles