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

Jordan Barr
Jordan Barr
17,827 Points

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