April 2026
Intermediate
683 pages
25h 29m
English
In this section, you’ll learn about inheritance, which is a controversial characteristic of classes. Although the mechanism is solid and clear, some programmers believe that inheritance is an antipattern and should be mostly avoided in favor of composition. In fact, relatively young languages like Go and Rust don’t support inheritance at all.
Swift supports single inheritance in classes—but just because you can doesn’t mean that you should. Let’s start by exploring what inheritance has to offer and then discuss the potential drawbacks in due course.
Basically, inheritance is the process of deriving a child class from an existing parent class. Typically, the child class inherits all properties, ...
Read now
Unlock full access