rentzsch/mogenerator — pull request #258 by protocool (2014-11-27 23:49:42+00:00)
Title: Generate scalar properties for primitive types

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 primitive 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.