I’ve uploaded a small playground available here to illustrate the
NSCoding with custom Swift objects.
Every class that will be encoded and decoded need to implement the
protocol and be an Objective-C object.
You can extend the
NSObject class as in the example above.
You can also use the
Object will be created using a specialized initialize:
And you will encode objects using a