Swift Tutorial: Classes vs. Structures


When creating a model in Swift, developers often have to choose between two main options. Structures or Classes, and some times even both. In this blog post, I will be explaining the difference between the two and when and how to use them.

Both Structures and Classes have a lot in common, such as defining properties for storing values, extending to expand their functionality, and conforming to protocols to provide standard functionality. Let us touch on the main difference that sets them apart: Structures are value types, while Classes are reference types.