title: Problems automatically resizing AVCaptureVideoPreviewLayer on rotation
body: <p>I've programmed a static framework, and therein I have a class called ViewfinderViewController, that set's up the camera with an AVCaptureSession. This ViewController also add's an AVCaptureVideoPreviewLayer as sublayer to its own view's layer:</p>
  
  <pre><code>    // code in ViewfinderViewController.m
      previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:captureSession];
      previewLayer.frame = self.view.bounds;
      previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
      [self.view.layer addSublayer:previewLayer];
  </code></pre>
  
  <p>The ViewfinderViewController also does some video processing, and offers user's of the framework to register for some delegate methods, in case something of interest was found or was not found in one of the processed frames.</p>
  
  <p>In the viewDidLoad method of my real application, I create an instance of ViewfinderViewController, set it's frame and add it's view as a subview:</p>
  
  <pre><code>    // code in the app's view controller viewDidLoad method
      ViewfinderViewController *vfVC = [[ViewfinderViewController alloc] init];
      vfVC.view.frame = self.view.bounds;
      [self.view addSubview:vfVC.view];
  </code></pre>
  
  <p>This works fine, as long as I disregard rotation (which I did until now). My main problem is, that ViewfinderViewController.view resizes its frame, but the AVCaptureVideoPreviewLayer does not. I'm a bit puzzeled: Shouldn't the previewLayer also resize automatically, as the view corresponding to it's superLayer is resized correctly?</p>
  
  <p>Any ideas? I'll gladly provide more information, but to keep the question shorter I won't go any further for now. Thanks.</p>