"Could not find any information for class named ViewController"

This bug has been driving me nuts since I started using Xcode (4.6.3). Whenever I try to link a Storyboard item to my code, I get the error:

Could not find any information for class named ViewController.

This happens with custom classes as well. I've tried methods such as:

  • Deleting the delegate data.
  • Removing and re-adding the classes.
  • Restarting Xcode.
  • Reinstalling Xcode.

I can't ctrl-drag to create connections in any of my projects no matter what the class is. The same problem happens with a brand-new template application. If I type in the code manually and then ctrl-drag, I can make a working connection, but I can't add it automatically. Nothing I've been able to find so far on the Internet has helped. Any pointers?


What solved this issue for me was actually deleting the class from the project.

Steps:

  1. In the project file explorer (left panel) find the class and right click -> Delete
  2. Remove reference (do not move to trash as you will lose the class for good)
  3. Right click on the folder that contained the class -> Add files to ...
  4. Find the class you just deleted in the file system

This seems to force Xcode to link the class back into the storyboard.

Note: for me the following did not work:

  • Closing Xcode
  • Cleaning the project
  • Deleting the class name from the storyboard and re-entering it

I think this is a bug on Apple's part


In case anyone is still frustrated by this, there's a trick to get things working.

What I do is manually enter an outlet into my class, for example: @IBOutlet weak var someView: UIView!, and drag from the code to the view in IB or storyboard. After this, I am able to drag from IB / Storyboard to my class to make connections, assistant editors recognizes the class in "Automatic", etc...

Works every time.


For me removing them from your target membership in the right column and adding them again did the trick enter image description here


Sometime Xcode does due to VC not referencing class file. The simple solution for this is:

write property manually as given.

class YourClassName{

     @IBOutlet weak var YourTableName: UITableView!

}

This will make a empty link sign before @IBOutlet, open your project in assistant editor then click link sign enter image description here and drag into the View which you want to connect (i have connected with TableView). and thats it. Enjoy Happy Coding!!!


I just had this problem on April 2017 with Xcode 8

Simply creating an outlet through code and compiling fixed it. eg:

@IBOutlet weak var containerViewHeight: NSLayoutConstraint!

You got to love Xcode…

Edit: Still happening on Xcode 9