Weebly / Cereal

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

Swift 3 support #26

Closed Sega-Zero closed 7 years ago

Sega-Zero commented 7 years ago

Full swift 3 support based on Cereal 2.0, finally :) depends on #25

ketzusaka commented 7 years ago

I think the enums should of remained without an argument label for the associated values. I think the enum is descriptive enough, and the documentation that Apple gives doesn't have an argument label on associated values: https://developer.apple.com/library/prerelease/content/documentation/Swift/Conceptual/Swift_Programming_Language/Enumerations.html

Sega-Zero commented 7 years ago

I thought I removed all the associated value labels, where did I missed it?

ketzusaka commented 7 years ago

Oh god, nevermind that. They are removed on the enums. I mistook CerealDecoder.____ as an enum case. In any case, I think things like CerealDecoder.rootCerealItemsWithData should actually be CerealDecoder.rootCerealItems(with data: Data)

Sega-Zero commented 7 years ago

Agree. Renaming will take some extra time :)

Sega-Zero commented 7 years ago

Should I rename CerealEncoder's dataWithRootItem(_ root: ItemType) throws -> Data { to data(with rootItem: ItemType) throws -> Data {?

ketzusaka commented 7 years ago

Yeah, and all the other dataWith______ calls please :)

Sega-Zero commented 7 years ago

Had to rename to data(withRoot:), because without root in parameter name it becomes unclear what kind of value the function expects.

Sega-Zero commented 7 years ago

Is there anything else? :)

Sega-Zero commented 7 years ago

Hope you guys merge this PR someday =) If no more changes required, please release pod version for swift-2, swift-2.3 and the latest swift-3

ketzusaka commented 7 years ago

Will-do. I'll look again today -- eddie's on vacation :)