Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't drag outlets from Storyboard to Assistant editor in XCode

I used to be able to do this in XCode, and now suddenly I can't in a new project I've opened that was sent over by a friend.

Is there a particular setting I have to change to start this again?

I.e. there is a textbox I want to link via Code, and now I just can't. :(

Need help guys!

like image 284
econclicks Avatar asked Jul 01 '12 22:07

econclicks


People also ask

How do I connect storyboard to ViewController?

Create a new IBOutlet called shakeButton for your storyboard button in your ViewController. swift file. Select the shake button in Interface Builder. Then hold down the control button ( ⌃ ) and click-drag from the storyboard button into your ViewController.

How do I add assistant editor in Xcode?

You can open the editor from the Xcode menu Editor -> Assisant . Nowadays, the Assistant Editor is more seen as just a second editor next to the primary editor.


2 Answers

You most likely have an assistant editor window opened to a wrong class, you will need to check on your currently selected view controller and make sure that its the same that is opened in the assistant editor

Or in assistant editor, select automatic (check screenshot)

enter image description here

enter image description here

like image 97
Omar Abdelhafith Avatar answered Sep 21 '22 02:09

Omar Abdelhafith


The solution for me was simply to press Ctrl while dragging...

like image 22
Ronen Rabinovici Avatar answered Sep 22 '22 02:09

Ronen Rabinovici