Swift Struct and Class Difference
Struct Value type Copied when passed or assigned Copy on write Functional programming No inheritance “Free” init initializes ALL vars Mutability must be explicitly stated Your “go-to” data structure Class Reference type Passed around via pointers Automatically reference counted Object-oriented programming Inheritance (single) “Free” init initializes NO vars Always mutable Used in specific circumstances The… Read More Swift Struct and Class Difference