0

I am trying to control-drag objects in the storyboard into the ViewController.swift, but nothing is working. I have tried sliders, buttons, switches, pickers, everything. I need to finish this app quickly, so please help!

3 Answers 3

7

You probably didn't set your view controller class in your Utility inspector.

When you are on your Storyboard, select your view controller, open the Utility inspector (right panel) and set the related class (which is ViewController in your case). This way, you'll be able to ctrl + drag

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

When you create your new file to inherit UIViewController, it should be a CocoaTouch Class and not a swift class. then you can drag from your Main.storyboard to the new View Controller.enter image description here

Comments

0

I had faced the same problem. This is what I noticed if you are trying to drag drop into the storyboard with ctrl button pressed the drag drop does not work. Just click drag and drop from the touchpad. I guess this should help.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.