title: Require type and protocol for method parameter
body: <p>I am playing around with Swift and am stumbling over the following problem: given I have the predefined class <code>Animal</code>:</p>
  
  <pre><code>//Predefined classes
  class Animal {
      var height: Float = 0.0
  }
  </code></pre>
  
  <p>I now write the class <code>Zoo</code> with the constructor accepting animals. But the <code>Zoo</code> wants every animal to have a name and hence defines the <code>Namable</code> protocol.</p>
  
  <pre><code>protocol Namable {
      var name: String {get}
  }
  
  class Zoo {
      var animals: Animal[] = [];
  }
  </code></pre>
  
  <p>How would you write an <code>addAnimal</code> method that requires the object being passed as parameter to be both of <strong>type</strong> <code>Animal</code> and <strong>conform to protocol</strong> <code>Namable</code>? And how do you declare that for the <code>animals</code> array?</p>
  
  <pre><code>    func addAnimal:(animal: ????) { ... }
  </code></pre>
  
  <p>In Objective-C, I'd write something like this</p>
  
  <pre><code>    - (void)addAnimal:(Animal&lt;Namable&gt;*)animal {...}
  </code></pre>