title: Launching Image Picker in Portrait Mode on iPad
body: <p>I am using the following code to launch the image picker in my iPad app (which uses Cocos2D) :</p>
  
  <pre><code>UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
  
  if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { 
  
      imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
      imagePickerController.showsCameraControls = YES;
      imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
      imagePickerController.delegate = self;
      imagePickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
      [self.view addSubview:imagePickerController.view];
      [self presentModalViewController:imagePickerController animated:YES];
  
  }
  </code></pre>
  
  <p>I want it to launch in the portrait mode all the time, but it always launches like this :</p>
  
  <p><a href="https://i.stack.imgur.com/cbCll.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cbCll.jpg" alt="enter image description here"></a>
  </p>
  
  <p>The image appears in portrait and the image picker UI is in landscape mode. But When I capture the image, it get's rotated 90 degrees clockwise.</p>
  
  <p>I want the image picker UI and the taken image, both to be in portrait mode. How can I fix this ? </p>