title: Swift Protocols and Extensions ~ when do methods get called
body: <p>Can someone help explain this protocol and extension from Ray Wenderlich's site: </p>
  
  <pre><code>    struct Pizza {
      let ingredients: [String]
  }
  
  protocol Pizzeria {
      func makePizza(ingredients: [String]) -&gt; Pizza
      //func makeMargherita() -&gt; Pizza
  }
  
  extension Pizzeria {
      func makeMargherita() -&gt; Pizza {
          return makePizza(ingredients: ["tomato", "mozzarella"])
      }
  }
  
  struct Lombardis: Pizzeria {
      func makePizza(ingredients: [String]) -&gt; Pizza {
          return Pizza(ingredients: ingredients)
      }
      func makeMargherita() -&gt; Pizza {
          return makePizza(ingredients:["tomato", "basil", "mozzarella"])
      }
  }
  
  let lombardis1: Pizzeria = Lombardis()
  let lombardis2: Lombardis = Lombardis()
  
  print(lombardis1.makeMargherita())
  print(lombardis2.makeMargherita())
  </code></pre>
  
  <p>Why does only lombardis2 make a pizza with basil? What I don't understand is why Lombardis1 uses the method described in the extension but l2 doesn't? </p>
  
  <p>Thanks. </p>