Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Storyboard as xml source?

I need to reorder View controllers in my Storyboard. 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. Also when I make move of the code inside it is not indented properly.

How to open Storyboard source as xml?

like image 830
new2ios Avatar asked Jun 01 '15 07:06

new2ios


People also ask

How to view storyboard code?

Select the storyboard in the navigator, right click and select 'Open As'. You should see 2 options 'Interface Builder - Storyboard' or 'Source Code' - select the Source Code option should fix your issue.

How to open storyboard 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.

What is the code to open main storyboard?

If you go over to the project outline and control click on the storyboard file and hold down the cursor, you will see the option to open as, this will let you open the storyboard as a certain type. Click on that and choose open as story board.


2 Answers

To open Storyboard as XMl source:

enter image description hereRight click on your storyboard, you will see a menu, hover over "Open As" then select "Source Code"

Hope this will help.

enter image description here

To go back to view storyboard in the design build mode,

Right click on your storyboard, you will see a menu, hover over "Open As" then select "Interface Builder -- Storyboard"

like image 90
JIANG Avatar answered Oct 26 '22 16:10

JIANG


If Xcode can't open the file .nib or .storyboard ( may be because of merge conflict ) then you can open in textEdit

open -a textEdit

like image 39
Naren Avatar answered Oct 26 '22 15:10

Naren