title: Extra white space when get visible content of UIScrollView
body: <p>There is a <code>UIImageView</code> inside a <code>UIScrollView</code> which user can scale it down and up and then save it:</p>
  
  <p><a href="https://i.stack.imgur.com/vVKR6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vVKR6.png" alt="enter image description here"></a></p>
  
  <p>The area under the <strong>navigation bar</strong> and top of the <strong>tab bar</strong> is <code>UIScrollView</code> frame. </p>
  
  <p>When user hits <strong>Done</strong>, image will be save in camera roll. It's what saved there (Photos App):
  <a href="https://i.stack.imgur.com/j8vFp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j8vFp.png" alt="enter image description here"></a></p>
  
  <p>I have no idea what is this empty space in the saved image.</p>
  
  <p>It's my code to save the image:</p>
  
  <pre><code>UIGraphicsBeginImageContextWithOptions(scrollView.frame.size, false, 0.0)
              let rect = CGRectMake(0, scrollView.frame.origin.y, scrollView.frame.size.width, scrollView.frame.size.height)
              self.view.drawViewHierarchyInRect(rect, afterScreenUpdates: true)
              let image = UIGraphicsGetImageFromCurrentImageContext()
              let imageData = UIImageJPEGRepresentation(image, 1)
              let compressedJPGImage = UIImage(data: imageData!)
              UIImageWriteToSavedPhotosAlbum(compressedJPGImage!, nil, nil, nil)
  </code></pre>
  
  <p>What I want to save is exactly the visible region of <code>UIScrollView</code>.</p>