How would you take a convoluted inheritance tree and use composition instead?
Utilisateur anonyme
Using Swift, you can create protocols for desired functional groups. Then, you can create protocol extensions that have concrete methods. Finally, make your concrete objects conform to said protocols via extensions. This is similar to what other languages call “mixing.” You can also use property and initializer injection to accept supporting objects. For example, use the Strategy Design Pattern.