title: Make UIImage From UIView but NOT in the main thread
body: <p>I'm using the well-known pattern to create an <code>UIImage</code> from an <code>UIView</code>:</p>
  
  <pre><code>+ (UIImage *) imageWithView:(UIView *)view
  {
      UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, [[UIScreen mainScreen] scale]);
      [view.layer renderInContext:UIGraphicsGetCurrentContext()];
      UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      return img;
  }
  </code></pre>
  
  <p>Now, my problem is that i have a very complex view with a lot of subviews on it, so this process of conversion takes about 3+(!!!) seconds.</p>
  
  <p>I tried forking it into another thread that run in the background and it really did improve the performance.</p>
  
  <p>The only problem is that as can I remember, it is not allowed to make UI related stuff not in the main thread.</p>
  
  <p>Am I wrong and this is perfectly fine?
  Or - if i'm right - what can be done to improve performance? is there any other method that i can use in a different thread but does the same work?</p>
  
  <p>Thanks a lot! </p>