title: iPhone snapshot including keyboard
body: <p>I'm looking for the proper way to snapshot the entire iPhone screen including the keyboard.  </p>
  
  <p>i found some code to snapshot the screen:  </p>
  
  <pre><code>CGRect screenCaptureRect = [UIScreen mainScreen].bounds;
  UIView *viewWhereYouWantToScreenCapture = [[UIApplication sharedApplication] keyWindow];
  //screen capture code
  UIGraphicsBeginImageContextWithOptions(screenCaptureRect.size, NO, [UIScreen mainScreen].scale);
  [viewWhereYouWantToScreenCapture drawViewHierarchyInRect:screenCaptureRect afterScreenUpdates:NO];
  UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  </code></pre>
  
  <p>but it doesn't capture the keyboard as well. it looks like the keyWindow doesn't include the keyboard view.  </p>
  
  <p>btw I need <code>UIImage</code> as final result, not <code>UIView</code>, so I can't use other snapshot API's.  </p>
  
  <p>Any ideas of to do that and with best performance? </p>