Cannot use CTRL+Drag for making a button action in Xcode?

2.4k Views Asked by At

Somethings I have a navigation controller and a view controller in my Main.Storyboard, but for some reason I can't create and link IBActions by holding down CTRL and clicking on a button on my view controller, then dragging it to my ViewController.swift. I could do this earlier!? What happened? Thanks

3

There are 3 best solutions below

1
On

Solved! I'm using a program that allows my mouse and keyboard to work between my Mac and PC without taking it out of the USB ports (works over LAN). For some reason the program is not recognizing a CTRL press which was causing the problem. After switch the keyboard to the mac itself, everything works!

0
On
  1. Open your xib file or storyBoard
  2. Click on File’s Owner
  3. Click on Identity Inspector and check class has same name as the file you’re trying to ctrl drag

This guy have awesome solution. Just need to correct your class name

ios – can’t drag and drop item by ctrl+drag xcode

0
On

this happened to me before : click on the view controller and then go to utilities -> identity inspector , and check the "Class"

The class has to be the same as the file you're trying to ctrl drag into

here is the picture: https://www.dropbox.com/s/5451kzit16espjo/Screen%20Shot%202015-07-08%20at%2010.50.45%20AM.png?dl=0