13 Replies
      Latest reply on Mar 16, 2020 3:11 PM by Yash Rachamalla
      eliasfrehner Level 1 Level 1 (0 points)

        Hello everybody

        This is my first post because I'm new to work with xcode. Now I have a problem. On the "Main.storyboard" I designed the first and second page. When I open the assistant editor on the first screen, it shows me the correct one with the name "viewController.swift". On the second screen I inserted a "SettingsViewController.swift" under class after creating a new "cocoa touch class" file with the name "SettingsViewController.swift". When I activate the assistant editor on the second screen, it shows me the file called "UIResponder.h". I can not switch it manually. What am I doing wrong? I hope for a helpful answer. And I apologize for my spelling or gramatik.

        Thank you very much

        • Re: Wrong assistant editor
          Claude31 Level 8 Level 8 (8,445 points)

          Let's look at it step by step to be sure to understand.

           

          First, which version of XCode ?

           

          On the "Main.storyboard" I designed the first and second page.

          1. You have 2 viewControllers in the storyboard. Exact ?

          2. The first was created automatically and has a class ViewController. Exact ?

          3. You created the second by dragging a ViewController from the object library to the canvas. Exact ?

           

          When I open the assistant editor on the first screen, it shows me the correct one with the name "viewController.swift".

          How do you open ? In XCode 10, by clicking on the intertwined OO

          On XCode11, by hitting the button at top right with the horizal lines and select Assistant Editor. Then the horizontal lines icon turn into the intertwined OO

          5. Which one ?

           

          On the second screen I inserted a "SettingsViewController.swift" under class after creating a new "cocoa touch class" file with the name "SettingsViewController.swift".

          6. You created a subclass SettingsViewControlle of UIViewController ?

          So in its code (SettingsViewController.swift), you should have:

          class SettingsViewController: UIViewController {

          7. Exact ?

          8. In the identity inspector for the scene, you have a custom class : SettingsViewController.  Exact ?

           

          When I activate the assistant editor on the second screen, it shows me the file called "UIResponder.h". I can not switch it manually.

          9. You select the second ViewController in IB (not the second screen, but second VC). Exact ?

          10. Then the associated class file (SettingsViewController.swift) should display on the right panel

          Check that you see AUtomatic written right to the intertwined OO at the top of the right panel.

           

          Thanks to read carefully and answer precisely to each question.

            • Re: Wrong assistant editor
              eliasfrehner Level 1 Level 1 (0 points)

              hello claude31

               

              Thank you for your quick response.

               

              My xcode version: 11.1

               

              Now I answer your questions:

              1. correct
              2. correct
              3. correct
              4. i clicked "editor" at the top of the bar and then "assistant".
              5. see point 10
              6. correct
              7. correct
              8. correct
              9. correct
              10. the name is displayed but I keep the horizontal lines when I click on assistant. unfortunately there is no OO to see.

               

              Thank you very much

                • Re: Wrong assistant editor
                  Claude31 Level 8 Level 8 (8,445 points)

                  I experience the same situation after testing on a new project.

                   

                  But, if you click on Automatic, at the top of the right panel, after selecting the SettingViewController in the storyboard, you should should see 2 submenu items : UIresponder and SettingsViewController.

                   

                  Selecting the second will lead you to the desired file.

                   

                  The right configuration is to click on Automatic, then select Top level Object in the pop up menu.

                   

                  Now, when you select a VC in storyboard, the right file will be displayed.

                  Unfortunately, it seems to return to Automatic when you reopen the project.

                   

                  A bit cumbersome.

              • Re: Wrong assistant editor
                bluesheepllama Level 1 Level 1 (0 points)

                I am having the same issue, I have gone too far make a new project and start over. I was wondering if there is an actual fix for this problem

                  • Re: Wrong assistant editor
                    Claude31 Level 8 Level 8 (8,445 points)

                    Did you try what I proposed in my post of Oct 9, 2019 9:10 AM

                      • Re: Wrong assistant editor
                        bluesheepllama Level 1 Level 1 (0 points)

                        I did yes, I asked this question on stackoverflow and this is the answer i got

                        "

                        "In Xcode 11 there is really no such thing as the assistant editor any more. It exists, but it is very limited and automatic, as you see. It isn’t needed any more because now you can just open multiple ordinary editor panes.

                        So turn off the assistant and just Option click on a file listing in the project navigator to show it in its own pane."

                         

                        Now i have tried this before i asked but it wouldnt do what I what i was trying to do.

                        I was trying to connect my storyboard to my code. Upon further inspection it turns out I forgot to set the class within my view controller to the desired one.