moko-kswift icon indicating copy to clipboard operation
moko-kswift copied to clipboard

Add a feature to generate Swift enums with associated values

Open hbmartin opened this issue 2 years ago • 3 comments

  • Does what it says on the tin, with special attention to generics, number types, and pairs/triples.
  • Requires use of my swiftpoet fork (exposing TupleTypeName inner types), hopefully upstreamed soon https://github.com/outfoxx/swiftpoet/pull/70
associated enum diagram

https://app.diagrams.net/#G18NIEe1pXeDIdozJ2Kv4hiNurb4vmwLdB

hbmartin avatar Feb 13 '23 03:02 hbmartin

@hbmartin thanks for contribution!

can you show please example of generated code and kotlin source for this generated code?

Alex009 avatar Feb 13 '23 06:02 Alex009

@Alex009 I added a test file that contains expected output at https://github.com/icerockdev/moko-kswift/pull/71/files#diff-6f9bcc9e1dfe050e77b438e13f7ecab7af5abbc22e6e44ddadeb8d0b4d708a38 Still making progress on the other todo's, does this look like its on a good path?

hbmartin avatar Feb 20 '23 23:02 hbmartin

@Alex009 I don't plan any further work here now, we are using this in production and it is serving well. I've attached a diagram to the description of this PR to explain the flow at a high level

hbmartin avatar Mar 05 '23 19:03 hbmartin