title: Disabling auto rotation for UIImagePickerController
body: <p>I want to disable UIImagePickerView's auto rotation. So I used the following code:</p>
  
  <pre><code>UIDevice *currentDevice = [UIDevice currentDevice];
  
  
          [parentViewController presentViewController:imagePicker animated:YES completion:nil];
  
          while ([currentDevice isGeneratingDeviceOrientationNotifications])
              [currentDevice endGeneratingDeviceOrientationNotifications];
  </code></pre>
  
  <p>It disables the ImagePickerView but it also disables the rotation of root view. But I want the auto rotation feature in my root view controller(or I want to disable auto rotation for only in my ImagePickerController). For clarification, before disabling the UIImagePickerController auto rotation, the auto rotation was active in my root view.</p>
  
  <p><strong>UPDATES &amp; Answer::</strong></p>
  
  <p>I found the answer. Write the following code to enable auto rotation:</p>
  
  <pre><code>[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  </code></pre>
  
  <p>If you have any image processing (I had actually), call this method after completing all the image processing tasks. In my case, I called it before the image processing, and it didn't enable the orientation.</p>