3

Why is my IBoutlet not showing when I try to link a text field to the swift controller view it says insert action instead of IBOutlet. I'm not trying to add an action what is wrong with this new update Is anyone else having this issue.


enter image description here

NickCoder
  • 1,504
  • 2
  • 23
  • 35

4 Answers4

2

enter image description here

In connection, currently, you have Action selected. Tap on it to open a dropdown and select Outlet.

Image Source : Here

UPDATE

in Type, you need to select your TextField Class, currently its set to Any. Once you change it, the outlet option will start showing.

Keshu R.
  • 5,045
  • 1
  • 18
  • 38
  • its preselected it won't allow me to change to outlet https://stackoverflow.com/users/8374890/iosarchitect-com –  Jan 17 '20 at 04:56
  • @FrankBlizzard can you show the screenshot. I wanna see how you are trying to create it – Keshu R. Jan 17 '20 at 04:57
  • I just upload the screenshot @iosarchitect-com –  Jan 17 '20 at 04:59
  • I changed it and action is still in default mode check new screen shot @iosarchitect-com –  Jan 17 '20 at 05:08
  • @FrankBlizzard have you given any custom class to your TextField in storyboard? – Keshu R. Jan 17 '20 at 05:12
  • I think your View Controller's class is not linked to your file first do that and then try to make outlet because from your image i see object type is `Exit`. – Kishan Bhatiya Jan 17 '20 at 05:34
0

Just copy this code and paste above viewDidLoad method.

@IBOutlet weak var passwordTextField: UITextField!

And click the small circle before this line and drag to your text field.

Note: Make sure you've set the view controller class name in storyboard

iOSDev
  • 199
  • 11
0

When you attach @IBActions (or @IBOutlets), you do not want to attach them to Exit Object on the View Controller. What i get from your image is your class is not set The problem might be that you are supposing you can form an action connection from a UITextfield in the scene of one view controller to a different view controller. You can't. You can form outlets and actions only between a view controller and the interface inside the same scene of your storyboard.

Make sure your View Controller's class is linked to your file, then go into the Assistant Editor making sure you selected Automatic.

enter image description here

If you have questions, let me know!

Jawad Ali
  • 13,556
  • 3
  • 32
  • 49
0

Verify that you are using Main.storyboard and not Launchscreen.storyboard

Image

Sam Autrey
  • 121
  • 1
  • 4