Is it possible to cast an object to a type which is stored in a member variable?
I've tried this:
let targetClass = type(of: MyTargetClass)
...
if anyObject is targetClass { // ERROR: use of undeclared type 'targetClass'
let test = anyObject as! targetClass // ERROR: use of undeclared type 'targetClass'
}
But it doesn't work because it says "use of undeclared type 'targetClass'"