如何检查两个UIViewController子类对象是否具有相同的子类?
在Swift 3中,您可以将对象的类型与type(of :)方法进行比较:
class VC1: UIViewController {
}
class VC2: UIViewController {
}
let vc1 = VC1()
let vc2 = VC2()
let typeComparisonResult = type(of: vc1) == type(of: vc2)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句