Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4 why do I see XML when clicking on MainStoryBoard.storyboard: seems like a bug

Tags:

xcode

ios

In an Xcode project, I see XML when clicking on MainStoryBoard.storyboard instead of the graphical design, why and how to restore the right view ?

Update: I think it's a bug of XCode 4.2 because on another project, when I click on version editor I have XML but when I click on standard editor it shows visual design.

Is there a way to fix this and not to force me to recreate my visual design by hand once again ?

like image 666
user310291 Avatar asked Feb 27 '12 12:02

user310291


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.

Should I use storyboard in Xcode?

Another benefit to using Storyboards (over creating views programmatically) is that you get to see what your view will look like at runtime without having to run your app. You can quickly make a change in Interface Builder and immediately see what it'll look like – without waiting for Xcode to compile and run.

How do I see storyboard in Xcode?

To get this, open the storyboard, click the 'assistant' editor, click the 'assistant editor menu button' (immediately to the right of the > arrow at the top left of the assistant window) and select Preview.

Can you mix storyboard and SwiftUI?

The answer is YES! Here we will be discussing a simple way to use SwiftUI into our existing project, which already consists of a storyboard.


2 Answers

To fix the issue, right-click MainStoryboard.storyboard, then choose "Open as >" and then "Interface Builder - iOS Storyboard".

like image 151
Jonathan Avatar answered Oct 06 '22 02:10

Jonathan


Make sure you are not using the source control editor, which shows you the changes for a given file. You can change this in the Toolbar at the top right.

Check this link in the section "Editor"

version-editor

like image 31
Besi Avatar answered Oct 06 '22 00:10

Besi