Having just watched a couple of videos on value types in Swift from WWDC this year,
Building Better Apps With Value Types in Swift
Protocol-Oriented Programming in Swift
I'm finding myself fully ready to embrace value types in my apps. This means fewer Class types and more Structs. But how do I save this data? Previously, with Classes, I'd adopt NSCoding, but that requires that I adopt NSObject, which is going to require that I use a Class rather than a Struct.
Here are the options as I see them:
- If saving is necessary, the model is too complicated for a Struct and should be redesigned as a class
- Design my own serialization
- Use a mediator class
How should I go about this?