Model data
Choose the form that matches the identity, lifetime, and variations of your data.
- Create a nominal value with a structure
- Share an identity with a class
- Understand an intrinsic class
- Specialize a class through inheritance
- Control access with a property
- Define static members and containers
- Adapt a type to several concrete types
- Run deterministic cleanup
- Define a contract with a protocol
- Add methods with an extension
- Represent an absent value
- Represent a choice with an enum and
match - Group values with a tuple
- Give another name to a type
- Inspect a value's metadata