Closed rpecka closed 1 month ago
This seems totally reasonable.
Agreed, we'd welcome a PR adding this to both string-based and int-based enums. I don't think it'll be possible for oneOf's, since they have associated values.
Hello, it’s been a while since my last contribution, but I find this issue interesting to work on. Is it available to pick up?
@rpecka have you started working on this or can @PARAIPAN9 pick it up?
I haven't started -- fine if someone else does.
Ok go ahead, @PARAIPAN9
This already landed in main, will be in the next release.
Motivation
I would like to implement a dropdown picker in my app which lets users select one of the possible enum values to send to an API. I'm able to do this by conforming the enum to
CaseIterable
myself in an extension, but if I do that, I have to implementallCases
myself which kind of defeats the purpose. I would like the declaration of the enum to have theCaseIterable
conformance so thatallCases
is synthesized automatically.Proposed solution
Add
CaseIterable
conformance synthesized enum declarations.Alternatives considered
No response
Additional information
No response