Could not insert new outlet connection: Could not find any information for the class named

Ege Kaan Gürkan picture Ege Kaan Gürkan · Apr 28, 2015 · Viewed 164.6k times · Source

I got an error on Xcode saying that there was no information about the view controller.

Could not insert new outlet connection: Could not find any information for the class named

Why is this happening?

Screenshot 1

Answer

Suragch picture Suragch · Dec 4, 2015

Here are some things that can fix this (in increasing order of difficulty):

  • Clean the project (Product > Clean)
  • Manually paste in

    @IBOutlet weak var viewName: UIView!
    // or
    @IBAction func viewTapped(_ sender: Any) { }
    

    and control drag to it. (Change type as needed.) Also see this.

  • Completely close Xcode and restart your project.

  • Delete the Derived Data folder (Go to Xcode > Preferences > Locations and click the gray arrow by the Derived Data folder. Then delete your project folder.)
  • Click delete on the class, remove reference (not Move to Trash), and add it back again. (see this answer)