上QQ阅读APP看书,第一时间看更新
Inheritance
A class can inherit methods, properties, and other characteristics from another class:
class SomeSubClass: SomeSuperClass
Swift classes do not inherit from a universal base class. Classes that we define without specifying a superclass automatically become base classes for us to build on. To override a characteristic that would otherwise be inherited, we prefix our overriding definition with the override keyword. An overridden method, property, or subscript can call the superclass version by calling super. To prevent overrides, the final keyword can be used.