Data-swift / ManagedModels

A SwiftData like `@Model` infrastructure for CoreData.
https://www.alwaysrightinstitute.com/managedmodels/
Apache License 2.0
101 stars 3 forks source link

Auto generate property initialisers #5

Open helje5 opened 1 year ago

helje5 commented 1 year ago

If the dev didn't specify an own initialiser, the macro should generate one, similar to what Swift itself already does for structures.

E.g.:

@Model class Item: NSManagedObject {
  var date : Date
}

Should generate:

convenience init(date: Date) {
  self.init()
  self.date = date
}

The code for this is already prepared in the Model macro, needs to be finished.