title: Extending a protocol to implement different behaviour
body: <p>Swift question, Say for example you have a protocol Bark:</p>
  
  <pre><code>protocol MakeSound {
     func bark()
  }
  </code></pre>
  
  <p>A super class Dog, that implements bark and also swim:</p>
  
  <pre><code>class Dog: MakeSound {
  }
  </code></pre>
  
  <p>Then different types of dog that extend that:</p>
  
  <pre><code>class Poodle: Dog {
  }
  
  class GermanShephard: Dog {
  }
  
  class SheepDog: Dog {
  }
  </code></pre>
  
  <p>But poodles yap, they don’t bark… all dogs bark, they just do it differently…How do I give them specific Bark behaviour?</p>
  
  <p>Extend a protocol?...</p>
  
  <pre><code>extension MakeSound {
      func bark()
      func yapper()
  }
  </code></pre>
  
  <p>But then Poodles and German Shephards have both behaviours (a yapping German Shephard?!)</p>
  
  <p>If I make 2 extensions and check the type class using where Self =  ?</p>
  
  <pre><code>extension MakeSound where Self: GermanShephard {
      func bark() {
          print("Bark")
      }
  }
  
  extension MakeSound where Self: Poodle{
      func yapper() {
          print("yap yap")
      }
  }
  </code></pre>
  
  <p>But I can only check for one class type, or dog type. SheepDogs also bark but I can't check here...</p>
  
  <p>I know In Java you can extend an interface with several different implementations. How can you do this using protocols in Swift using protocols to solve this problem?</p>