Weebly / Cereal

Swift object serialization
BSD 3-Clause "New" or "Revised" License
369 stars 13 forks source link

More support for RawRepresentable (dictionaries, arrays) #15

Closed Sega-Zero closed 8 years ago

Sega-Zero commented 8 years ago

In #13 there was only a support for a single RawRepresentable values and I noticed that I cannot use same automatic support for dictionary keys. So, this pull requests covers an arrays of RawRepresentable types and dictionaries. The whole point of both pull requests is to be able to add an extension to any RawRepresentable type with CerealRepresentable conformance in any swift module, not just a module where it is declared. This swift compiler bug made logic separation nearly impossible.

I have a two questions:

  1. Made quite a lot of overloaded methods for RawRepresentables, should I separate them into an extension?
  2. Should I patch Readme.md to add a few lines about working with RawRepresentable?
ketzusaka commented 8 years ago

@Sega-Zero Yeah, I'd pull them into an extension. I should probably do that for all the types, as this issue is pretty prevalent due to a number of compiler issues =\

And sure thing, add some about RawRepresentable!

Sega-Zero commented 8 years ago

Done. All additional RawRepresentable overrides are now in a separate extensions. I also cleaned up an example a little bit, if you don't mind.