Instruction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Inheritance

Swift has a preference for structs. It recommends you start by using a struct until you need some feature that’s only available for classes. Inheritance is one of these features — it only works with classes.

PuwaanUxyoyg Nuhojiqs Begjexxd Foormuhx Drsfucf edj Pitriig
Pafeec oww iqcesr hcacwapavemiex jzea

Polymorphism

A subclass could also have methods that are relevant and useful for that specific classification. You can override a method in the parent class to do something different, such as using additional properties. Polymorphism translates to “many forms”. It occurs when each subclass object invokes its own version of a method, giving it many forms. You don’t need to write branching code to specify the object’s behavior; each object knows exactly what to do.

See forum comments
Download course materials from Github
Previous: Introduction Next: Demo