Shark
Shark copied to clipboard
Make enums CaseIterable
I'm not sure if this is actually possible, but can we make the generated enums conform to CaseIterable? The use case here is that I have a list of images in my preview assets for testing purposes, and I need to put them in a long list. Without CaseIterable, I need to manually make the array of images.
I can certainly see a use case for that. Merging https://github.com/kaandedeoglu/Shark/tree/namespaced_color_assets would be a requirement though, since it contains a refactoring towards a common enum builder.
Unfortunately this no longer applies cleanly, as I started my work on the framework-specific code generation without knowing of the existence of this very branch.
@mickeyl I thought it would be enough to just add a configuration option here, similar to #44? Kind of like --case-iterable would slap CaseIterable onto every enum?
@denizdogan I figured we can just conform unconditionally to CaseIterable. We don't need it for the localizable strings though, or do we?
@mickeyl Not as far as I know
This is now life as per the 1.6.0 release.