Your First Swift 4 & iOS 11 App - Part 3: Section | Ray Wenderlich

Learn how to add a button to the app and connect it to some Swift 4 code that prints a message to the console.

This is a companion discussion topic for the original entry at

In this section, when connecting the Hit Me! button to the showAlert() function, you said to drag the Hit Me! up to the View Controller. When I do this, nothing happens. Help??

If nothing shows up when you drag from a button up to the view controller, that usually means Xcode can’t find any methods in the view controller marked with @IBAction.

The way to fix it is to double check that an action method exists in your view controller, like the video shows how to make at 4:30. If that still doesn’t work, try comparing your project to the solution. I hope that helps!

i think you need to press control then drag the hit me to view controller.

This is probably a rookie question. After you create the “Hit Me” button in the view controller, in the video ray says run and it pops up on the iPhone to the right. I am confused right here, what exactly do I do to complete this task of having the “Hit Me” button pop up on the iPhone. I’ve watched the video over and over.

Thanks in advance.

@sspencervt Just hit the “play” button in the upper left of Xcode - it looks like a triangle.

This topic was automatically closed after 166 days. New replies are no longer allowed.