Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

ios

swift

I use Xcode 7.2

I can use Control+drag to swift file to create a @IBOutlet
enter image description here

But I can't drag @IBOutlet in swift file to storyboard. Here I don't use any other key, just drag.
enter image description hereActually 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

like image 206
Rick Avatar asked Jan 15 '16 08:01

Rick


People also ask

How do I drag from storyboard to ViewController?

Try selecting your view in the storyboard and clicking on the identity inspector on the right side in class. Enter your view controller name and then drag and drop the item from the storyboard to the view controller. Hope it helps. Save this answer.

How do I add an IBOutlet?

drag a "custom view" view from the object library to your storyboard scene. CTRL-drag from the view to the viewController. You should get presented with a list of suitable items to connect to. Your IBOutlet should be in the list.


1 Answers

don't use Control, only drag with mouse from circle icons.You can see in the picture below. Circle icons in red box

enter image description here

like image 104
yildirimosman Avatar answered Oct 06 '22 20:10

yildirimosman