title: Swift: property observers for computed properties
body: <p>As far as I know, Swift allows us to set property observers for either stored and computed properties. But if computed property value depends on some backing store, property observers are not fired when these backing store values are changed:</p>
  
  <pre><code>public class BaseClass {
      private var privateVar1: Int = 0
      private var privateVar2: Int = 0
      public var property: Int {
          get {
              return privateVar1 * privateVar2
          }
          set {
              print("some setter without effect")
          }
      }
      private func changeSomeValues() {
          privateVar1 = 1
          privateVar2 = 2
      } 
  }
  
  public class SubClass : BaseClass {
      override var property: Int {
          didSet {
              print("didSet \(property)")
          }
      }
  }
  </code></pre>
  
  <p>didSet of SubClass isn't called when changeSomeValues is called.</p>
  
  <p>Let's consider a case: we have such BaseClass in a third-party framework. We define SubClass in our app. The question is: how can we rely on SubClass observers without knowledge about property nature: is it stored (and we can rely on observers) or computed (and then we can't expect firing observers each time when we expect it)? Is it possible? If no, is it an incapsulation violation?</p>