Swift, Solid Principles In Swift, Easy, Dependency Injection, Swift Programming.
marked as abstract, and each subclass must implement it. This approach requires modifying the base class when adding new shapes, violating the OCP. In the good design, we use a protocol (Shape) to define a contract that shapes should adhere to. This allows new shapes to be added without modifying