Swift, Solid Principles In Swift, Easy, Dependency Injection, Swift Programming.
Ostrich subclass overrides the fly() method from the Bird superclass and raises an error. This violates LSP because it breaks the substitutability of Ostrich objects in places where Bird objects are expected. In the good design, we use a protocol (Bird) and ensure that both the Sparrow and Ostrich