I want to store a reference on a type to compare it later with an object.
I tried to do:
let myClassRef = AClass.self // store a reference to the type of AClass
if myObject is myClassRef {
// Do something
}
But it just does not work. How to use a AnyClass object ? Alternatively, how to get an AnyClass object from an instance (this produce the same result as what I am expecting)
Make your
Aclass
subclass ofNSObject
& useisMemberOfClass()