Connecting Storyboard elements to code

Hi all!
Unfortunately, I cannot figure out how to use VO in order to connect Storyboard user interface elements to code... I know it's supposed to work by using the Connections Inspector and using VO commands to drag an action to the assistant editor, but it just won't work for me... I'm also new to Storyboard, and thus curious if one has to drag the action to the AppDelegate.h or the ViewController.h file?
Thanks a lot for any clarifications!


A Possible Answer

Member of the AppleVis Editorial Team

Hello, First, you'll be connecting to whichever file is the view controller. For a default Mac app, that can be the appDelegate.h file if you use xibs, or a view controller if you use storyboards. For iOS, it has to be a view controller. Have a look at this guide, which may still work. Xcode 6 seems less reliable for making connections; if it won't work at first, try manually writing a method stub or an outlet declaration, then tying the UI element to that instead of to a blank line.

Hi there,

Hi there,
many thanks! I got it to work, and the guide is still mostly appropriate for the latest version of Xcode! Unfortunately though, I've now discovered that Apple's 'getting started' guides are a bit behind... Basically, my situation is that I really would like to learn programming using Swift rather than Objective-C. I've tried Objective-C before, but I find its syntax a bit clunky in some situations. Swift seems to be a much better option, and obviously Apple sees it as the 'next step' in app development. Only problem is that all the guides, such as the 'Your First Mac App' one, are still purely based on Objective-C... There's of course the language guide in the iBooks Store, but from what I can tell so far, this only teaches about Swift's syntax, not about integration with Cocoa or frameworks such as Foundation. I really hope that the material will be updated soon, or that someone will publish a good book on the topic!
Many thanks once again! :-)

Can you give details on what

Can you give details on what yyou did different than the guide (mosstly ?????)?

I am kind of unable to make the connections.


Hi Splyt,

Hi Splyt,
hmmm, that's interesting! I didn't actually do anything different, the only difference in xCode 6.1 is that more things are labelled within the Connections Inspector, which actually makes the process a bit more streightforward. Maybe you should outline your steps, as then it'll probably be easier to track down any problems that you're having.
All the best,

creating new connections not globally working

App Developer


I have been following a book on coding in xcode with swift and encountered an obstacle though I have been able to use the recommended method of routing vo cursor etc to make connections to buttons and other UI elements. I cannot seem to make an outlet for a text input element no matter how I do it.
Here are the procedures I tried:
1-have assistive mode turned on
2-in the main storyboard, I go to the table of elements and choose my text element
3-I go to the connections panel and find actions/ connect action (it is no longer unknown as it used to be in previous xcode builds).
4-I route the cursor then make a shift vo command space for mouse down
5-I turn cursor tracking off
6-I move vo to the line after my class declaration
7-route the mouse (I hear xcode has new window, which should not happen)
8-I mouse up

I've tried this method for other actions such as touch up, or for creating an outlet with the label elements and it works. Not for text input elements.

Can anyone help me here? I'm pretty much stuck since a few days ago because of this.

Best regards