-
Notifications
You must be signed in to change notification settings - Fork 394
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
We desperately need *Value methods in the Swift template. #219
Comments
Actually now I think the Swift template should be declaring numeric values as NSNumber — not Int16, Int32, Int64, Double, Float, etc. This is causing major problems. Checking the template for Cocoa, NSValue was used. Not sure why you guys would think Swift should be different... |
Now I'm not so sure which way is better. Certainly there is a consistency issue with the Obj-C legacy, which used NSValue. But the scalars are proving to be cleaner in Swift. Perhaps a mogenerator option is warranted here? I think I saw someone else mention that too. |
The (working) Swift templates on the Now I'm thinking even the Swift templates need |
how bout: if the model has the attribute designated as optional, use a normal optional scalar type like Int? |
Agreed, right now I just get crashes since swift tries to access nil non-optionals |
We are working on adjusting how we generate Swift in #302. If you have feedback, let's put it there. |
The Swift compiler in Xcode Beta 3 still doesn't play well with the Cocoa classes produced by mogenerator. It requires us to use KVC exclusively to get or set any property in an NSManagedObject entity, and that is a major burden on us lowly devs.
In Objective-C, the .h/.m files generated by mogenerator produce type-safe convenience getters and setters of the form "myPropertyValue". But those are all missing from the Swift template in 1.28.
Please consider adding these unless there's a good reason not to. :)
The text was updated successfully, but these errors were encountered: