There seems to be preference for choosing enums with parameters over Structs. Personally I've always been annoyed by inability of different components to extend an "enumerated" set of values, not to mention the extra work to extract enumerated values as needed (but explained here).
Both Swift structs
and enums
create a namespace that guides autocompletion. But what I really like about using structs
is the ability to easily prototypes, instances providing default values.
With the addition of callAsFunction(...)
building on prototypes is even easier.