title: iOS 7 UIImagePickerController has black preview
body: <p>I have a UIImagePickerController being called with sourceType camera and 80% of the time I get a black preview. If I wait, let's say around 30 seconds, I get a good preview and it will be good for around 50% of the time, then it can break again.</p>
  
  <p>The image in question is very similar to this. <a href="https://stackoverflow.com/questions/16746839/idevice-camera-shows-black-instead-of-preview">iDevice camera shows black instead of preview</a></p>
  
  <p>Other people imply that GCD might be causing some issues with the camera, and that updates to the UI while the image picker is being loaded break it. I put a lock on every GCD block that calls the main thread for this purpose.</p>
  
  <p>This is an example of an image that rotates to simulate an activity indicator.</p>
  
  <pre><code>-(void)animateLoadingImage {
  
  if (isMainThreadBlocked) {
      return;
  }
  
  self.radians += M_PI_4 / 2;
  [UIView beginAnimations:@"progress rotation" context:nil];
  [UIView setAnimationDuration:.1];
  self.loadingImageView.transform = CGAffineTransformMakeRotation(self.radians);
  [UIView commitAnimations];
  
  
  }
  </code></pre>
  
  <p>PS:  Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.</p>
  
  <p>This shows ALWAYS when I try to open the picker controller, but it shows it even if the camera shows the preview correctly. I don't think the error is around here but this bugs me a lot also.</p>