Data-swift / ManagedModels

A SwiftData like `@Model` infrastructure for CoreData.

Home Page:https://www.alwaysrightinstitute.com/managedmodels/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto generate property initialisers

helje5 opened this issue · comments

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.