Inheritance in Swift

Class can inherit methods, properties and subscripts from another class. The class which inherits from another class is called subclass and the class from which it inherits is called as superclass. Inheritance is one of the unique behaviours that makes classes different from other types in Swift. Classes can override the methods, properties and subscripts that are inherited and provide custom versions within them. Classes can also add property observers to inherited properties (both stored and computed properties).

 

Leave a Reply