Update: Serialising enums and structs in Swift 4

So, now Swift 4 is here and things are changing. One of the big improvements of Swift 4 is the incorporation of serialisation for classes, structs and enums. In contrast to the previous versions which rely on the old NSObject/NSCoding mechanisms the new Codable protocol is not restricted to classes only. And even better, if you do not have special needs the compiler will synthesise the needed functions for you as we will see later.