Cannot create an outlet on swift - ios

I am trying to create an outlet but xcode doesn't let me, I press ctrl+drag as always.
Here a screenshot of the viewcontroller and conversationVC.swift:
btw in the top right when I write the class as conversationVC.swift it always delete itself and stays empty,
please share your knowledge.

I have found the answer here, need to click on yellow button and then to set the class name

Related

Can`t drag #IBOutlet from swift file to storyboard ViewController in Xcode 7.2

I use Xcode 7.2
I can use Control+drag to swift file to create a #IBOutlet
But I can't drag #IBOutlet in swift file to storyboard. Here I don't use any other key, just drag.
Actually when I moving mouse to the spot before #IBOutlet, nothing happened and when I trying to drag it a breakpoint added.
1.I`m sure I use the right Class name
2.My project is not in a strange path or name
don't use Control, only drag with mouse from circle icons.You can see in the picture below. Circle icons in red box
Changed Behavior
The behavior has changed in new versions of Xcode (I'm not certain but it might have been since 7+.). Older versions of the product might still have the gutter shortcut working.
Now you have to either open the Connections Inspector or right-click on the view controller in the Document Outline. Once open, drag from the defined IBOutlet to your UIView subclass (UIButton, UITextField, etc...)
Connections Inspector
Controller View
Official Guidance
Search your local help for: Interface Builder Connections Help: Creating an Outlet Connection. You will find these are the only methods that now work. The gutter shortcut does not work.
Nota Bene:
You can confirm this behavior and other changes to Xcode shortcuts by
choosing the following menu Help > Xcode Overview and
taking a look at Part V: Building a User Interface, section Connecting Objects In Code.

Can't create an outlet connection by drag and drop

I'm new to iOS XCode6 ,trying to create a single view app . When I try to create an outlet connection to the label by drag and drop , nothing shows up as you see in the picture below. I did search the web all over to find an answer but nothing worked. I'm working from a text book which is made for beginners,following all instructions and nothing there mentioned about this issue. Any help will be appreciated.Thanks .
What you select is a LaunchScreen. You can not drag and drop from there into your viewController
Select the storyboard,set the class to the right viewController,then you can drag outlets
Set the class to the viewController here
Then you can drag outlets like this

Can't create an outlet with a bar button

So I'm trying to have a user press Done and then an alert will be returned. So here's the issue. When I try to create an outlet from the Done button I can't. This is all I see
I'd expect for the little window to pop up then I'd be able to create it. Any ideas? I'm trying to add the outlet in my ViewController.swift file
GitHub download
Check to make sure your UIViewControler in the storyboard is set to the right class:
Per the solution recommended by everyone:

NSObject instead of the header file

I made an simple UITableViewCell. I put there image view and an label.
I'm trying to drag them to the header file and then use them.
But once I'm clicking on the tuxedo icon I'm getting an NSObject.h instead of WorkoutCell.h .
Here is a picture:
(source: gyazo.com)
I'm trying to add the label and the image view. but I'm pretty new to ios/iphone/xcode so if there is any other way to do it without dragging it (with the ctrl key ofc) to the header file. please let me know .. ;)
and yes I tried to navigate to that header file, but it doesn't appear there ..
May be your cell's class in the identity inspector is NSObject . Change it to WorkoutCell.h . Now try
In your Interface Builder you need to set the custom class of the view.
1) Click on the view in interface builder.
2) On the right pan choose the 3rd tab from the left.
3) Choose the right Custom Class.
I've seen this happen lots of times before.
If you click the third icon from the left of the tuxedo, you can navigate your project files.
From here select the folder your WorkOutCell.h is in.
Maybe someone else can provide a more comprehensive answer as to why this happens, but with this navigation you will at least be able to access your WorkOutCell.h

I want to change name of the view in the IB. Please see the screenshot

I want to rename View to View1. How can I do this?
Not sure what you are planning to do. If you want to have this view renamed in IB objects inspector:
Select the view
open right panel
go to the Identity Inspector(3rd icon)
fill Identity->Label (with placeholder "Xcode Specific Label").
However, if you want to access the view from view controller(use it in code), you should read about IBOutlets.
in the identity inspector, there's a section called "Identity". in that section is a textfield for "Label". changing that will change the name that appears in xcode. note that this is only something that has effect in xcode - it doesn't change anything about how the view is used in the app. is that what you want?
I think the operator wants to change the name in the outline. This can be done as described but it is no longer under Identity but Document.

Resources