Structs, What Are They Good For?
There are four scrumptious flavors of named types in Swift: protocols, enumerations, structures and classes – all custom data types that can be created and given a name. Of these, enums, classes and structs can be used to model data, protocols being used to tell the others how to behave. The choice between using a struct and a class has some interesting nuances. The hope of this post is to clear up these murky waters leaving us in a golden shower of data model clarity!