I have an array SomeClassthat is a superclass of other classes.
The array has all of these random classes. Is there a way to use a switch (as opposed to else if let something = elm as? TheSubClassType)
In pseudo code:
for AObjectOfTypeSomeClass in MyBigArray{
switch the_type_of(AObjectOfTypeSomeClass){
case SubClass1:
let O = AObjectOfTypeSomeClass as! SubClass1
...
...
...
}
}
source
share