Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom encoding functions for RawRepresentable enums #27

Open
tengyifei opened this issue Mar 28, 2017 · 0 comments
Open

Allow custom encoding functions for RawRepresentable enums #27

tengyifei opened this issue Mar 28, 2017 · 0 comments

Comments

@tengyifei
Copy link

tengyifei commented Mar 28, 2017

Suppose the following:

enum Gender: Int {
    case female
    case male
}

extension Gender: CerealType {
    // custom encode and decode
}

And encode was called on a variable of type Gender, then the RawRepresentable override version will be called, ignoring the custom serializers.

I know it's not a huge issue, but it could be fixed by providing an encodeCereal function for example, to explicitly invoke the custom serializers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant