💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## Inheritance Swift classes do not inherit from a universal base class. Classes you define without specifying a superclass automatically become base classes for you to build upon. ~~~ class Car: Vehicle { var speed: Double = 0.0 init() { super.init() maxPassengers = 5 numberOfWheels = 4 } override func description() -> String { return super.description() + "; " + "traveling at \(speed) mph" } } ~~~ You can present an inherited read-only property as a read-write property by providing both a getter and a setter in your subclass property override. You cannot, however, present an inherited read-write property as a read-only property. You can prevent a method, property, or subscript from being overridden by marking it as final