【发布时间】:2016-03-03 09:04:01
【问题描述】:
我有一个 UIViewController
class WelcomeViewController: UIViewController
还有一个 UIView
class SignUpView: UIView
现在我想在SignUpView 的WelcomeViewController 代表中设置:
protocol SegueDelegate {
func runSegue(identifier: String)
}
class SignUpView: UIView { ... }
并连接它
class WelcomeViewController: UIViewController, SegueDelegate {
如何在我的 WelcomeViewController 中设置这些委托?当我尝试设置时:
override func viewDidLoad() {
SignUpView.delegate = self
}
它返回我
Instance member 'delegate' cannot be used on type 'SignUpView'
我怎样才能找到解决方案?
【问题讨论】:
-
我假设
delegate属性不在类级别,而是在实例级别;我说的对吗?
标签: ios swift uiview delegates protocols