Why am i seeing 'type does not conform to protocol' in swift?

This error happens when a type is declared to adopt a protocol but doesn't implement all of its required methods or properties.

Example:

  protocol Animal {
      func speak()
  }
  class Dog: Animal {
  }
  
Solution:

  class Dog: Animal {
      func speak() {
          print("Woof!")
      }
  }
  

Beginner's Guide to Swift