Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am using Xcode 7 and Swift, and my control drag action is not working [closed]

Tags:

xcode

ios

swift

I am using Xcode 7 and when I am using control drag to make an action with my UITextView to the ViewController.swift file, only the blue line shows up, but no line underneath the ViewController.swift file in which I can choose for an Outlet or Action.

like image 889
Rajat Khare Avatar asked Mar 28 '16 05:03

Rajat Khare


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.

Can you use storyboard with SwiftUI?

The answer is YES! Here we will be discussing a simple way to use SwiftUI into our existing project, which already consists of a storyboard. Let's dive in then! Step 1: Create a view controller as a subclass of UIHostingController .


1 Answers

These type of issues come into play when you try to connect the ViewController to a class that has a different class mentioned in the Identity Inspector of the storyboard. Make sure your view controller has the same class name mentioned in the storyboard to which you are trying to connect.

As shown in the image, make sure the class name is correct to which you are trying to connect.

enter image description here

Thank You!

like image 106
tush4r Avatar answered Sep 30 '22 19:09

tush4r