I have the following code. How can I resolve the error in the last line?
protocol Animal { func walk() } struct Cat: Animal { func walk() {} in
My approach
@objc protocol Animal { func walk() } @objc class DummyAnimal: Animal { func walk() { } } @objc class Cat: DummyAnimal { override func walk() { print("meow") } override init() { } } var obj: Any = Cat() var cat = obj as DummyAnimal cat.walk()