Not able to connect IBOutlet in XCode 13

My setup: I am using Mac Book Pro M1. I have been using XCode 12.5 Beta 3. I also installed XCode 13 recently.

Problem: I created the simple project in XCode 13 with just 1 image view, 1 label, and 1 button. I open ViewController and trying to drag the connection from the label to ViewController to create a connection. But it is not adding the connection. It shows that line but simply not adding the IBOutlet. The same is happening with ImageView. Although, being able to add IBAction for my button. I clean the project also and tried creating another project too. The same issue exists.

Now I launch XCode 12.5 Beta3 and create the same project there. I am able to add IBOutlets there.

Not sure where the problem lies.

Have a look at issues Navigator. There may be message advising to update to new settings for Xcode 13. Do it.

Also do a Clean Build forlder in Xcode13.

Note: You could also try to connect from code to storyboard:

  • declare the IBOutlet
@IBOutlet var myLabel : UILabel!
  • Then control drag from the circle of IBOutlet to the Label in storyboard.

That should connect.

  1. I tried with "Clean Build Folder". No luck

  2. I tried declaring the IBOutlet and tried to connect code to storyboard. It does not connect

  3. Issue Navigator not showing any message for settings, See image

Are you sure you declared (in Identity Inspector) your ViewController (the one on screen with TableView) as ViewController (the class you try to connect to) and not the default UIViewController ?

A few other comments:

  • it is better to give the class a more specific name than ViewController
  • As you have a tableView, your class will have to conform to UITableViewDelegate and UITableViewDataSource
  • Don't forget to declare the delegate for the table view (you can do this in IB or in code)

Sorry, my bad. You were right. It's a missing class name issue. I am able to figure out identity inspector

Not able to connect IBOutlet in XCode 13
 
 
Q