This must be very simple, but Xcode is really frustrating me. On literally my very first iOS app ever:
main.storyboard
and ViewController.swift
side by side.For the life of me, I don't understand why this happens and I don't understand why this menu pops up and how to avoid it, but it means I can't use the control-drag feature at all.
I should add that I'm using a 2017 Macbook Pro with a touch bar and that I don't have problems dragging and dropping in any other app, nor in Xcode in any other circumstance.
I can see that it wants me to select either the control or one of its parents, but how do I drag when the menu pops up?
Like sanjaykmwt has said. That menu only shows up if you press the shift button while control-dragging.
The menu is for you select views that are underneath (covered by) other views. Sometimes you might have trouble selecting certain views if they are under other views, right? That's when you shift+control+click and the menu will show you all the views that are on top of each other. In your screenshot, the button is onto of the UIView
and the UIView
is on top of the UIViewController
.
Another way to do control-drag is to do a right-click drag. If you haven't noticed already, control+click is equal to a right-click.
You can also try connecting the outlet using the connections inspector:
Drag the circle next to "New Referencing Outlet" into the assistant editor normally.