我正在使用 Xcode 7 和 Swift,但我的控件拖动操作不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36256772/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:40:37  来源:igfitidea点击:

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

iosxcodeswift

提问by Rajat Khare

I am using Xcode 7 and when I am using control drag to make an action with my UITextViewto 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.

我正在使用 Xcode 7,当我使用控件拖动对UITextViewViewController.swift 文件进行操作时,只显示蓝线,但在 ViewController.swift 文件下方没有可以选择 Outlet 或行动。

回答by Fennec

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

当您尝试将 连接ViewController到具有Identity Inspector故事板中提到的不同类的类时,这些类型的问题就会发挥作用。确保您的视图控制器与您尝试连接的故事板中提到的类名称相同。

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!

谢谢你!