title: Protocol Extension Initializer
body: <p>I would like to know what the protocol equivalent is for an initializer in a simple class that only contains initializing functionality and is only intended to be extended in a concrete class.</p>
  
  <p>So probably the easiest is to show the code - I'm looking for the protocol extension equivalent of the following:</p>
  
  <pre><code>import UIKit
  
  class Thing {
      var color:UIColor
      init(color:UIColor) {
          self.color = color
      }
  }
  class NamedThing:Thing {
      var name:String
      init(name:String,color:UIColor) {
          self.name = name
          super.init(color:color)
      }
  }
  var namedThing = NamedThing(name: "thing", color: UIColor.blueColor())
  </code></pre>
  
  <p>I was expecting the code to look something like:</p>
  
  <pre><code>protocol Thing {
      var color:UIColor {get set}
  }
  extension Thing {
      init(color:UIColor) {
          self.color = color
      }
  }
  class NamedThing:Thing {
      var name:String
      var color:UIColor
      init(name:String,color:UIColor) {
          self.name = name
          self.init(color:color)
      }
  }
  </code></pre>
  
  <p>I've seen solutions suggested in other StackOverflow questions(eg. <a href="https://stackoverflow.com/questions/31059693/how-to-define-initializers-in-a-protocol-extension">How to define initializers in a protocol extension?</a>) but I'm not sure they work nor specifically address this problem of additional parameters in the class initializer. </p>