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

Generate scalar properties for primitive types #258

Closed
wants to merge 3 commits into from

Conversation

protocool
Copy link
Contributor

This introduces a "scalars" boolean template variable for both the Objective-C and the Swift templates.

When true, property declarations for non-optional attributes with hasScalarAttributeType will use the appropriate scalar type and, in the case of Objective-C, omit the generated *Value accessors.

Additionally (when scalars=false), generated NSNumber properties for hasScalarAttributeType attributes in the Swift template will only be optional when the attribute is optional, just as it is for Strings or NSDate etc (if that's contentious then let me know, I just don't know of a reason why NSNumber should be any different).

This change may go some way to easing the pain described in #219, but Swift *Value accessors are a separate issue that probably still needs to be addressed.

Compatibility: Core Data support for scalar properties appeared in iOS 5 and OS X 10.7, though my own testing is limited to iOS 8 and 10.10.

@jeffwatkins
Copy link

I’d really love to see this become part of the standard distribution.

@justin
Copy link
Collaborator

justin commented Mar 22, 2016

We are declaring pull request and issue 0 now that 1.3 is out. If this is still an issue you'd like to see address with 1.30 and going forward, please open a new issue so we can start a fresh discussion. Thank you!

@justin justin closed this Mar 22, 2016
@protocool protocool deleted the generate-scalars branch August 20, 2016 16:13
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

3 participants