Swift: Recursive enumeration

Recursive enumeration in Swift is a enumeration which has a instance of another enumeration as one of the associated values of the enumeration cases. We indicate recursive enumerations with the keyword indirect. If all the cases in the enumeration has one or more instance of another enumeration, the keyword indirect  can be place in the enum definition itself. If any of the cases contain enumeration instance, then the keyword must be placed before that particular case alone.

 

Leave a Reply

%d bloggers like this: