10

I am trying to create a new Swift project and am having some issues. I tried to create a new single page application but when I build I get an error saying:

2014-06-07 11:04:13.752 Matchismo (Swift)[2007:598021] Failed to instantiate 
the default view controller for UIMainStoryboardFile 'Main' - perhaps the 
designated entry point is not set?

But when I create the same single page application project with Objective-C as the language, it compiles and runs just fine. Is there some manual thing I must do in Swift to get a project up and running?

My understanding for this error is that I need the default view to be set, which is merely checking a box on your view controller's attributes (picture below). I tried the solution suggested in this stackoverflow post but it didnt help and I can't find much more help on the subject with Swift being so new. Any suggestions are appreciated.

My main view controller

Screenshot for error

Community
  • 1
  • 1
jaredsmith
  • 7,306
  • 3
  • 20
  • 31
  • 5
    possible duplicate of [iOS 7 - Failing to instantiate default view controller](http://stackoverflow.com/questions/20875823/ios-7-failing-to-instantiate-default-view-controller) – Nishant Oct 13 '14 at 09:28

3 Answers3

14

Select the ViewController Scene. Now, select the inspector panel from the sidebar options. Check the “Is Initial View Controller” attribute option, save the project and build the project again.

user6919809
  • 156
  • 1
  • 3
2

Some times it doesn't take the initial view controller.Just create a new storyboard with anyname you want and set that name into the interface in your application setting.

Copy paste the code from previous storyboard and run the app. The application will run fine. Dont forget tocheck the initial scene in storyboard.

Shane
  • 49
  • 6
1

By following the below steps, it would work fine:

  1. Select the Scene which is the type of ViewController/UICollectionViewController in Main.storyboard.
  2. Select the Attribute Inspector in the right sidebar.
  3. Click/Check the “Is Initial View Controller” attribute.
  4. Re-Run of the project and this should solve the issue.
Deepak Singhvi
  • 727
  • 6
  • 13