Concept Flow - Why inheritance is class-only in Swift
Define class A
Define class B inheriting A
Create instance of B
Access properties/methods from A and B
Attempt inheritance with struct/enum
Compilation error: inheritance not allowed
Reason: structs/enums are value types, classes are reference types
Conclusion: inheritance only for classes
Inheritance works only with classes because classes are reference types that support shared behavior, while structs and enums are value types that do not support inheritance.