title: Swift subclass' init must set all properties before calling super but property requires super's init to complete first
body: <p>I'm trying to write two Swift classes, one is a subclass of the other and needs to take one of the superclass' properties and use that to configure its self. </p>
  
  <pre><code>class BaseClass {
      let someValue: Double
      let size: CGSize
  
      init (size: CGSize) {
          self.size = size
          self.someValue = size.width / 2.0 //Doesn't really matter how this is calculated
      }
  }
  
  class Subclass: BaseClass {
      let someNewValue: Double
  
      override init(size: CGSize) {
          super.init(size: size)
          self.someNewValue = self.someValue * 2
      }
  }
  </code></pre>
  
  <p>The problem is that the subclass requires that its call to <code>super.init</code> is after it sets initial values for all of its properties. However the <code>self.someNewValue = self.someValue * 2</code> call which does this, relies on the super's init having been called first to set <code>self.someValue</code>. I guess I could get around this by turning <code>let someValue: Double</code> to <code>var someValue: Double</code> on the BaseClass, and then set its value in the subclass's init as well as the base class's init, but that just seems bad. </p>