What is the difference between a struct and a class in Swift?
A struct is a value type — assigning it copies. A class is a reference type — assigning it shares. Swift's standard library is built on structs, and the guidance is to start with one and reach for a class when you need identity, inheritance or deinit.