title: swift protcol extension chaining initialization of class
body: <p>How to initialize if I change the following struct to class :-</p>
  
  <pre><code>protocol P {
      init()
      init(str: String)
  }
  
  extension P {
      init() {
          self.init(str: "some default")
      }
  }
  
  struct S : P {
      var str: String
  }
  
  let s = S()
  print(s.str) // prints - some default
  </code></pre>
  
  <p>I tried adding default memberwise initializer (after changing to class) :-</p>
  
  <pre><code>class S : P {
      var str: String
      init() {
          self.init(str: String)
      }
  }
  </code></pre>
  
  <p>It shows  error: -
  error: type 'S' does not conform to protocol 'P' class S : P. There are other errors too. How to get initialization done if I change struct to class ?</p>