Can’t view Storyboard and swift code on the same screen

I am just started to learn iOS programming using Xcode.
This may seem a stupid question but I can't figure out how to set the screen to show the storyboard on the left and the swift code on the right. I am new to Xcode and am working through an exercise and need the Storyboard scenes and the specific swift file where I need to drag from the scene to the swift file. I have clicked on Assistant and the assistant editor should be set to Automatic > LocationViewController.swift. When I click on Assistant with Storyboard selected, it says no Assistant results, if I click on the swift file in the tabs I get 2 copies of the swift file??
I have looked for a tutorial or info on the web but can't find any info on this topic.
Could someone please help?

Accepted Reply

Is this right?
When I click on the swift file in the first window (left) and then click on Assistant I get 2 swift files but the one on the right is an incomplete version of the code. The original one says no selection and the one on the right says Interface.
Still can't open both storyboard and the Swift file?
If I have the storyboard open and click Assistant it says No Assistant Results.
If this second copy of the swift file is a error how do I get rid of it? I have searched in finder an can only find one in my project.

Replies

Would this be the reason?
Code Block 2021-03-18 17:54:41.850809+0000 LetsEat2[11993:109147] [Storyboard] Unknown class _TtC8LetsEat222locationViewController in Interface Builder file.
2021-03-18 17:54:41.878913+0000 LetsEat2[11993:109147] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x121a05cb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tableView.'

How do I solve the error?
  • Hello Rocky48, did you solve the problem you mentioned ? I need learn how to solve.

Add a Comment

set the screen to show the storyboard on the left and the swift code on the right

A simple way to do it:
  • open storyboard

  • then option-click on a swift file you want to show.

it will display the file on the right.

You can also click on the icon at the top right which says "add editor" and then select the file to display in.
                                       _________
Note : icon looks like   |__|__+__|
                                       
You can also use menus to open a new panel:
  • File > New > Editor

  • or, if you want to open the new panel below, File > New > Editor Below

For the error message, you probably have a bad connection between an object in IB and its IBOutlet. You should disconnect and reconnect.
I don't think you are understanding what I mean!
If I have Main.Storyboard and locationViewController open in the tab bar with only the storyboard in the window. I then select the icon to open Assistant, it displays UIViewController.h and not the locationViewController.swift.
If I click the LocationViewController in the document outline pane it says no Assistant results, therefore I can't make the connection into the LocationViewController class.
I believe if I sort out this connection correctly it may solve the error I get.
Is this right?
When I click on the swift file in the first window (left) and then click on Assistant I get 2 swift files but the one on the right is an incomplete version of the code. The original one says no selection and the one on the right says Interface.
Still can't open both storyboard and the Swift file?
If I have the storyboard open and click Assistant it says No Assistant Results.
If this second copy of the swift file is a error how do I get rid of it? I have searched in finder an can only find one in my project.