Closed WilhelmOks closed 2 years ago
Looks alright! Merged.
I just realized that it doesn't work like intended because the synthesized initializer is internal access level and not usable from a project importing it as a module.
See this for more info: https://stackoverflow.com/questions/26224693/how-can-i-make-the-memberwise-initialiser-public-by-default-for-structs-in-swi
We could generate them from Xcode and mark public but that's really annoying.
Put the explicit initializers like
init(from decoder: Decoder)
into extensions of the structs, so that it doesn't prevent the generation of the default memberwise initializers. The default initializers are needed to easily create instances of the models for the purpose of mock or example data (e.g. for preview Views in SwiftUI).