I have some nested classes definition in Swift, like:
class Animal {
class Mammal {
class Tiger {}
class Wolf {}
}
class Bird {}
}
Is it possible to introspect this hierarchy to automatically get an array of metatypes from it, like this, but in runtime:
[
Animal.self,
Animal.Mammal.self,
Animal.Mammal.Tiger.self,
Animal.Mammal.Wolf.self,
Animal.Bird.self,
Animal.self,
]
Aucun commentaire:
Enregistrer un commentaire