我是 xcode
和 iOS
的新手。
我正在学习苹果教程,但我什么也想不通。
在教程中,当需要连接 storyboard
和 ViewController.swift
时,使用 control-drag 完成连接
从 storyboard
到 viewController.swift
,它就像一个魅力。
如果我将 subview
添加到 storyboard
,apple 通过代码在实现 custom cocoa touch class
中进行连接和声明 UiView Protocol
,不使用 control-drag
。
现在,考虑到苹果编写的代码对我来说很清楚,我只是想知道为什么 control-drag
不起作用。
我试过做同样的事情,通过 ui 添加一个 button
,然后尝试 control-drag
到 cocoa touch 类,但我不能这样做。
但如果我做同样的事情,但尝试将它连接到 ViewController.swift
,它会完美地工作。
现在,我只是想知道为什么会这样。
我不能在自定义 UiView
中使用 control-drag
吗?
感谢您的回答。
最佳答案
关于ios - 无法在 cocoa touch uiview 类和 Storyboard 中的 subview 之间控制拖动 xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38869365/