Swift, Solid Principles In Swift, Easy, Dependency Injection, Swift Programming.
depend on details; details should depend on abstractions. Example: // Bad design class LightBulb { func turnOn() { // logic for turning on } func turnOff() { // logic for turning off } } class Switch { private let bulb = LightBulb() func operate() { bulb.turnOn() } } // Good design protocol