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 View Controllers and Views Using IBAction to Execute Methods

How does Swift know which action I chose?

So I am associating a variety of actions to my button. I chose "Touch Drag Inside" "Touch Up Inside" - but the generating code just lists @IBAction func showFact () {} @IBAction func myTouchOutside () {}

These are my own function names - how do I know what action is associated with these functions?

1 Answer

Hey Sophia,

I believe the cocoa touch library (layer) handles all the code for all touch and user interaction events, my guess is this is associated with the views in our app.

I think I will do a bit of digging on this to understand what is going on. It's a very interesting question :)

Cheers Jordan