Hi, I am a new person learning to make my first app with Swift. As I was watching your youtube video iOS Tutorial (2020): How to make your First App I was doing everything as you were doing but in near the end in the connecting elements part of the video where you use the editor assistant as I can find the editor assistant but I am getting something else than what you are getting even though I clicked it many times. So can you resolve my problem by telling me what I did wrong and how I can fix it.
Welcome to the Community.
The easy way to open the correct assistant editor is:
- Select the object you want to connect from the Scene list. The Deal button in this case, for example.
- On the far left (the document navigator) in your list of swift files, hold down the Option key and click on the ViewController that you want to connect the button.
This will pop the correct viewController for the object you want to connect.
The above option you give me doesn’t give me the editor assistant I am looking for as I am trying to find the assistant editor that looks like below. Appreciate if you can help on that, but thanks anyway for trying to help me.
The simplest way to get Xcode to open up in Assistant Editor mode AND make sure that it is linked to the right ViewController is to start with the storyboard selected.
Next is to hold the Option key down and then click on the ViewController.swift file you want to use to connect the outlets, actions, view etc to from the storyboard. This will work every time and cause you less grief than other ways of getting Xcode into Assistant Editor mode.
on your storyboard click on your viewcontroller (the very top), at the custom class this is where your .swift filename should be. make sure its not grayed out and is linked to the correct viewcontroller (a different page should have a different viewcontroller).
after that then just open your assistant editor normally and it should work https://www.youtube.com/watch?v=rTn02yqIj6w