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

Support for “Uses Scalar Type”. #352

Merged
merged 1 commit into from
Oct 7, 2016
Merged

Conversation

rokgregoric
Copy link
Contributor

Summary of Changes

The Uses Scalar Type checkbox was not handled and therefore when using a swift template the generated output was wrong. Instead of using scalars it was always generated as NSNumber.

Now it mimics the behaviour of the Xcode generator.

Because the usesScalarValueType is not (yet) available on NSAttributeDescription I used a userInfo entry to pass the value around.

@rentzsch rentzsch merged commit 1c77f4e into rentzsch:master Oct 7, 2016
@rentzsch
Copy link
Owner

rentzsch commented Oct 7, 2016

Hey Rok, this is an interesting Pull Request. Well done!

Also @atomicbird: momcom saves the day yet again.

@radianttap
Copy link
Contributor

I was just looking into adding this as well, great work Rok.

Built from source and in my initial testing, it seems to work just fine.

@djbe
Copy link

djbe commented Oct 18, 2016

Bit late since it's already merged, but:
Is there a reason why optional scalars are not supported? According to this it should be possible.

Also, why use implicitly unwrapped optionals if an attribute isn't an optional? In swift 3 the behaviour of these changed quite a bit.

@rokgregoric
Copy link
Contributor Author

Xcode handles that the same way. It doesnt generate optional scalars. I am exacly sure right now. Tried a lot of options and that seamed the best.

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.

None yet

4 participants