title: UIView --> UIImage for non-visible view?
body: <p>I'm trying to go work around the inability to use custom UI elements in Watchkit. My app uses custom UIButtons (MRoundedbutton) and what I'm trying to do is replicate them on the Watchkit interface by creating images of them and using that as the background for the WKInterfaceButton. The problem is that I'm not able to convert UIViews to UIImage when the view isn't visible. This is the code I'm using, it's giving me an index out of bounds error on <code>drawViewHierarchyInRect</code>.</p>
  
  <pre><code>- (UIImage *)convertButtontoImage:(MRoundedButton *)button
  {
      UIGraphicsBeginImageContextWithOptions(button.bounds.size, YES, 0);
  
      [button drawViewHierarchyInRect:button.bounds afterScreenUpdates:YES];
      UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
  
      return image;
  }
  </code></pre>
  
  <p>Since there is really no screen/window in a Watchkit extension, how would we go about creating images from would-be views? </p>