Ray Wenderlich Functions and Types Course - Part 10
Last chapter! The course suddenly got a lot harder with properties and methods so hopefully this will be accessible. Then it will be the consolidation one! Start Time - 17:47 Inheritance For classes, inheritance is something I've used before. class Person { var firstName : String var lastName : String init (firstName: String , lastName: String ) { self . firstName = firstName self . lastName = lastName } } class Student : Person { var grades : [ Grade ] = [] } let bob = Student (firstName: "Bob" , lastName: "Stevens" ) All of that is fine. The super and sub class etc. Person is a base class and student inherits from that. Person could have as many sub classes as necessary. You can subclass from a subclass. Paused for approx 25 minutes. Polymorphism - a subclass can be treated as its own type or one of its superclasses. This...