[英]How to get type of class of delegate in swift
How can I know the type of class of a delegate? 我如何知道代表的班级类型?
self.delegate.isKindOfClass()
and self.delegate.isMemberOfClass()
are not working. self.delegate.isKindOfClass()
和self.delegate.isMemberOfClass()
无法正常工作。
When I print println(self.delegate)
It prints the caller controller class. 当我打印
println(self.delegate)
它将打印调用方控制器类。 But I cant check it. 但我无法检查。
If you want to check if your delegate is kind of class use the following 如果您要检查您的委托人是否属于类,请使用以下命令
if self.delegate is ExampleClass {
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.