Classes and Multiple Inheritance
suggest changeSwift does not support multiple inheritance. That is, you cannot inherit from more than one class.
class Animal { ... }
class Pet { ... }
class Dog: Animal, Pet { ... } // This will result in a compiler error.
Instead you are encouraged to use composition when creating your types. This can be accomplished by using protocols.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents