title: Swift 3: Observing a read-only property
body: <p>So there's this class in SpriteKit:</p>
  
  <pre><code>open class SKNode : UIResponder, NSCopying, NSCoding, UIFocusItem {
  
      ...
  
      open var scene: SKScene? { get }
  
      ...
  </code></pre>
  
  <p>I would like to trigger some logic when the <code>scene</code> property becomes not nil.</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>class MyNode : SKNode {
  
      override var scene: SKScene? {
          didSet {
              if scene != nil {
                  // my custom logic
              }
          }
      }
  }
  </code></pre>
  
  <p>but I'm getting an error: <code>Cannot observe read-only property 'scene'; it can't change</code> which makes sense in theory.</p>
  
  <p>In practice, the value of the property <em>does</em> change:</p>
  
  <pre><code>let node = SKNode()
  print(node.scene?)  // nil
  
  scene.addChild(node)
  print(node.scene?)  // SKScene
  </code></pre>
  
  <p>Is there some black magic that I could use instead?</p>