I'm dealing with enum and subclassing in Swift. Each child bring its own new properties which have to be stored in an Enum. This enum is declared with some values in the mother class. I'd like to add some value to this enum. I can't find out how to do it, I tried this without result :
extension MotherClass {
enum Enumeration {
case NewProperty
}
}
The only way to add items to an
enum
is to add them directly to its declaration. You cannot add more items to anenum
through inheritance or any other extension mechanism: theenum
must be fully defined at the point of its declaration.