I have Enum , which contains the other enum:
enum Products { enum A { case bla case blabla static var name = { return "It's product A" } } enum B { case mnym case mnymmnym static var name = { return "It's product B" } } let allProductsType: [Any] = [A.self, B.self] } I want to write some function that can be iterated through the array allProductsType and return me an element to which I could refer: element.name. Is it possible to do this? And if so, how?