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

Add support for Bool conversion #71

Merged
merged 1 commit into from
Apr 9, 2016
Merged

Add support for Bool conversion #71

merged 1 commit into from
Apr 9, 2016

Conversation

gca3020
Copy link
Contributor

@gca3020 gca3020 commented Apr 9, 2016

To add Bool conversion, I followed the pattern that existed for the other types. However, since Swift does not have built-in type conversion to Bool, I made use of the .boolValue member of NSString. This converts any string starting with 't', 'T', 'y', 'Y', or a non-zero integer to 'true' and everything else to 'false'. It does not throw exceptions.

@drmohundro drmohundro self-assigned this Apr 9, 2016
@drmohundro drmohundro merged commit 4297735 into drmohundro:master Apr 9, 2016
@drmohundro
Copy link
Owner

Awesome, this looks fine. Thanks for submitting the PR! I'll get a new release out shortly.

@gca3020 gca3020 deleted the bool-deserialization branch April 9, 2016 15:09
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

Successfully merging this pull request may close these issues.

2 participants