Swift Language Classes and Multiple Inheritance


Swift 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.