9 Replies
      Latest reply on Oct 12, 2019 4:07 AM by eliasfrehner
      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 (7,245 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 (7,245 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
                      eliasfrehner Level 1 Level 1 (0 points)

                      That is precisely the problem. in the submenu only "UIResponder.h" can be seen. and when I click on "top level objects": "no assistant results".

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

                          Did you try both of the following:

                           

                          - Click on Automatic, at the top of the right panel, after selecting the SettingViewController in the storyboard

                          -> Do you see 2 submenu items : UIresponder and SettingsViewController.

                           

                          - Click on Automatic, then select Top level Object in the pop up menu.

                               -> Does it offer you to select the SettingsVC ?

                           

                          May be there's a bug ; at least it is very clumsy.

                           

                          You should file a bug or enhancement request.