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

I only have outlet and outlet collection no action

Hey, I was trying to figure out this problem from a while, I can't select action when I'm trying to create a action with a button. I only have a "Outlet" and "Outlet Collection" and whenever I'm trying to drag my mouse it isn't appear.

https://ibb.co/kTDxg5 that's what it looks like

4 Answers

Attila Marosi
Attila Marosi
6,144 Points

I think you want to use UIButton, but in the screenshot, you've attached, UIView displayed. Alternative way is removing codes between line 23-27 and type: @IBAction func actionMethod(sender: UIButton) { // Code goes here... }

Then you will see an empty circle beside the line and you can connect this with the proper UIButton. Hope it helps.

What I'm trying to say is, when I'm dragging the mouse "Action" is not avaiable, maybe is from the settings somewhere. Thanks for the answer anyways!

Check one more time that you are dragging from UIButton. And check that the type 'in the dialog' is not UIView (like on your screenshot) it should be UIButton, Than i guess you will see 'action connection'.

Attila Marosi
Attila Marosi
6,144 Points

You drag the background (uiview), not the UIButton

No I am dragging the button actually

Now everything makes sense...I was dragging with "command" but when I dragged pressing "option" I did work "