mogenerator
mogenerator copied to clipboard
Merge Swift42 branch changes
Summary of Changes
This incorporates a variety of updates to generated Swift code. Objective-C generated code is not affected by this PR. Changes are listed in the updated README and below.
This does not include Codable support for NSManagedObject
subclasses, which has been shelved for now.
Addresses
-
[NEW] Update Swift templates for better Swift style (Aleksandar Vacić)
-
[FIX] Fixed invalid call of
NSManagedObject.fetchRequest()
(Vincent Esche) -
[NEW] Add support for URI and UUID attribute types (Trevor Squires)
-
[NEW] Expose information when custom type is set through userInfo (Aleksandar Vacić)
-
[NEW] Add Codable property support via a new attributeCodableTypeName user info key (Tom Harrington)
-
[CHANGE] Nullability annotations for generated primitive accessors (Michael Babin)
-
[FIX] Support for “Uses Scalar Type” (Rok Gregorič)
-
[FIX] Swift 3
NSData
toData
(Christopher Rogers) -
[FIX] Add specialized
fetchRequest()
func to Swift's machine generated files (0xpablo) -
[FIX] Correct Swift machine template for singleton (fetchOne…) fetch request results (Warren Burton)
-
[FIX] Expose allAttributes and allRelationships (Trevor Squires)
👋🏻 Hi, what's the status on this PR? I'm building it locally and the generated code is working well though it has warnings with Swift 5.
If you're still planning on doing merges I can take a stab at updating the templates for Swift 5 and submitting a PR.
Hi @dginsburg! This PR is more or less ready to merge, I've just been needing someone to test it. If it seems good to you, that's probably all we need. I'll get things moving this week.
I'm happy you feel it's good enough to merge, but you may not want to base that on my experience. I mean it's been fine but this is for a new project and my usage has been basic.
Is there a status update for this? Getting started on a new project and would love to use all the Swift features :)