title: Capture image/screenshot of SCNView with SCNNode hidden: drawViewHierarchyInRect afterScreenUpdates not working
body: <p>The code below captures a screenshot of SCNView1, but it's not quite working.</p>
  
  <p>SCNView1 contains Node1. The goal is to capture SCNView1 without Node1.</p>
  
  <p>However, setting <code>afterScreenUpdates</code> to true (or false) doesn't help: the screenshot contains Node1 no matter what.</p>
  
  <p>What's the problem?</p>
  
  <pre><code>Node1.hidden = true
  let screenshot = turnViewToImage(SCNView1, opaque: false, afterUpdates: true)
  // Save screenshot to disk
  
  func turnViewToImage(targetView: UIView, opaque: Bool, afterUpdates: Bool = false) -&gt; UIImage {
      UIGraphicsBeginImageContextWithOptions(targetView.bounds.size, opaque, UIScreen.mainScreen().scale)
      let context = UIGraphicsGetCurrentContext()
      CGContextSetInterpolationQuality(context, CGInterpolationQuality.High)
      targetView.drawViewHierarchyInRect(targetView.bounds, afterScreenUpdates: afterUpdates)
      let image = UIGraphicsGetImageFromCurrentImageContext()
      UIGraphicsEndImageContext()
      return image
  }
  </code></pre>