In this specific context:
class Test : UIViewController {}
class Test1 : UIViewController {}
let test = Test()
let test2 = Test1()
let f = test2.isKind(of: test2.classForCoder)
print(f)
Output: true
It might be another idea for type checking
Besides
let q = type(of: test) == type(of: test)
Will return true, but only if it was the same class as the subclass
source
share