enum
s
Let's explore: Code generation of Swift On stream the other day, we played around with code generation of an enum
in Swift. Perhaps you would like to try it out yourself?
How to participate
- Fork this repo. The tests are currently failing.
- Modify the files in the
Codegen
folder - Run
swift test
to check that your solution works - Open a PR to this repo.
- The tests should pass on GitHub's Actions.
I'll discuss the solutions on stream!
YouTube link
Watch the VOD to see how we solved it on stream, and preview the issues we ran into.
https://www.youtube.com/watch?v=i0aNRLYyMAc
Legal
By submitting your pull request, you are ok with anyone copying it for any reason without attribution, and without warranty.
Targets
-
UnderwayCore
a tiny copy of my app's core library, with only what's needed for this exploration. -
Codegen
extensions on the types inUnderwayCore
, adding theasSwiftCode
computed variable -
CodegenTests
tests to ensure theCodegen
works correctly.