Updated for Xcode 12.0
Classes and structs give Swift developers the ability to create custom, complex types with properties and methods, but they have five important differences:
I’ll explain these differences in more detail soon, but the point is that they exist and that they matter. Most Swift developers prefer to use structs rather than classes when possible, which means when you choose a class over a struct you’re doing so because you want one of the above behaviors.
SPONSORED Use Paw to build, test and describe web APIs. Paw has a lightning fast native macOS interface to compose requests, collaborate in real-time on API specs, and generate client code for your applications. You can import and export API definitions.
Link copied to your pasteboard.