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?
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?
Here are some things that can fix this (in increasing order of difficulty):
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.
Or if none of the above works, type out the name of the outlet into the file first @IBOutlet weak var headerHeightConstraint: NSLayoutConstraint!
and then click and drag from the outlet in the nib to the variable you just programmatically created. It should work without any of the hassle of cleaning, building, and deleting anything.
None of the tips in the best answer worked for me. Was going crazy. Then noticed that the Assistant Editor had somehow gotten set to Manual and I was on the ViewController.swift (Interface) instead of the ViewController.swift file.
Changed that and problem solved. A bit embarrassing but hey, we are all learning.
I had the same issue. I tired below solutions but didn’t worked :
Clean Project (cmd + shift + k)
and even Clean Project Build (cmd + shift + alt + k)
Deleted Derived data
and Module Cache content
Below workaround to this issue :
IBOutlet / IBAction
manually (copy paste preferred)Utilites
window Connection Inspector
IBOutlet
and IBAction
written in source file with Interface Builder.I solved this problem by programmatically creating the Labels and Textfields, and then Command-Dragged from the little empty circles on the left of the code to the components on the Storyboard. To illustrate my point: I wrote @IBOutlet weak var HelloLabel: UILabel!
, and then pressed Command and dragged the code into the component on the storyboard.
I found an easier workaround as I this bug can be found on XCODE 9.
Step one go to your viewcontroller and manually write the property you want to connect as the below example, make sure you use the below format.
@IBOutlet weak var questionsStackView: UIStackView!
Step two go to your storyboard and connect your view or whatever your trying to connect to the property you created in step 1.
The above will save you time of removing and cleaning derived data.