iOS Build a Simple iPhone App with Swift View Controllers and Views Using IBAction to Execute Methods

Seth Danner
Seth Danner
2,592 Points

Stuck on adding an IBAction to the code...

At 0:50 seconds into the video, we are shown how to add an action to the button by clicking (while holding down the control key) and dragging the button into the code just before the end of the ViewController class. The box opens up where we can set the connection to Action, and the name to showFact, and the argument to None. However, when I do those things and then click Connect, I get an error from Xcode that says: "Could not insert new action connection: Could not find a class named ViewController in the language Swift." I'm not sure what's going on here?...

1 Answer

Bruce Röttgers
Bruce Röttgers
18,209 Points

Look if you've selected in the instance inspector the right class like here: https://postimg.org/image/a7bdrco7p/