Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Views and View Controllers View Controllers and IBAction

Jonathan Matthews
Jonathan Matthews
2,002 Points

In the code, how does the IBAction function know which button to link to? I see the dragging, but I don't see the code.

I see that by dragging the button element from the storyboard to the assistant editor and creating the IBAction function links that function to the button, but I don't see which part of the code links them. Is it something obvious I'm missing or is it in another view?

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

In the gutter (this is to the left of your code and will have line numbers if they are enabled), next to any code you attached to a button there will be a circle with a cross in it, if you hover over it you will see how the code is attached to the button.

1 Answer

Interface Builder creates a lot of the code in hidden ".xib" files (sometimes called ".nib" files). You may not be able to see some of the actual code, because Xcode writes it in these hidden .xib files.