Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 - Main.storyboard only showing up as source code, Interface Builder missing

Somehow my Xcode settings got messed up as it would only show my Main.storyboard file as XML code. I've been told this can be fixed by selecting the Interface Builder from the "Open As" menu, but there is nothing under the menu (the only "selection" is a greyed-out "<None>"). I've cleared my Xcode caches, but this does not help. Other than that, my project still compiles properly.

How can this be resolved?

like image 399
Danny Avatar asked Feb 08 '15 19:02

Danny


People also ask

Why is Main storyboard not showing up in Xcode?

You have SwiftUI enabled in your project, which does not use storyboards anymore. Your layout is inside the ContentView. swift file. If you do want to work the old way, with storyboards, you should uncheck 'Use SwiftUI' in the project creation screen.

How do I get to the main storyboard in Xcode?

Select the SingleViewApplication when the templates are presented. Now let's add a button to the app – select the Main. storyboard from the Project Navigator (on the left side of Xcode). Once the Storyboard loads in the center pane, use the Object library to add a button to the storyboard.

How do I open storyboard source code?

I know that I need to open Storyboard as source code using right clicking on the file and using menu Open as... . Then I can open Storyboard as xml file. My problem is sometimes the source is opened as text - there are no colour differences on the comments for example.

How do I add a storyboard to an existing Xcode project?

Those exact steps (I am using XCode 4.5 and iOS 6.0 ): Add new storyboard to the project by File->New->File... ->Userinterface->storyboard. Go to project summary and select MainStoryboard and select the storyboard name you just created.


2 Answers

As so many people have pointed out, right-click on the file and hover over Open As and select Default - Interface Builder.

However, if this is not an option for you because Open As shows <None>, make sure you are in the standard editor and not the version editor. Go up to View in Xcode menu --> view --> hover over Standard Editor and select Show Standard Editor. Now repeat the steps others have suggested and you should get the results you're looking for.

like image 171
Stephen Paul Avatar answered Nov 25 '22 11:11

Stephen Paul


change to Standard Editor by clicking 'Command + Enter' key . Then Main.storyboard may show as Interface Builder.

like image 41
SHEREENA T K Avatar answered Nov 25 '22 11:11

SHEREENA T K