-1

i want to change the orientation of only one view controller. I found some answers where i have to set orientation in every view controller. Is there any easy way?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Abhinav Dobhal
  • 598
  • 7
  • 12
  • https://stackoverflow.com/questions/17466048/how-to-allow-only-single-uiviewcontroller-to-rotate-in-both-landscape-and-portra – jerfin Jul 20 '17 at 07:28
  • Check out this answer (its swift) https://stackoverflow.com/questions/42911102/cannot-get-landscape-with-portrait-mode-for-image-picker-to-work This will help you change a single VC to landscape/portrait whatever. – J. Doe Jul 20 '17 at 08:35
  • Duplicate of this question https://stackoverflow.com/q/28938660/6044997 The best answer give a nice function so it's really easy to handle in your ocntrollers – Damien Jul 20 '17 at 09:39

2 Answers2

1

You can't change the orientation of only 1 view controller in your storyboard. But you can put your view in a xib file and add it in your storyboard. https://stackoverflow.com/a/34524583/2870477

Floris M
  • 1,764
  • 19
  • 18
  • See this answer: https://stackoverflow.com/questions/42911102/cannot-get-landscape-with-portrait-mode-for-image-picker-to-work – J. Doe Jul 20 '17 at 08:35
  • He said we want to change the orientation *using storyboard*, which is not possible. In the code, it's possible – Floris M Jul 20 '17 at 08:49
  • Hmm, I misread it to quickly... If you edit your answer (just change 1 character) I can delete the downvote. Sorry. – J. Doe Jul 20 '17 at 09:28
-2

You can not change orientation for a single viewcontroller. So you have to check mark for all device orientation in xcode for project and to stop orientation of all viewcontrollers except this one.

  • See this answer: https://stackoverflow.com/questions/42911102/cannot-get-landscape-with-portrait-mode-for-image-picker-to-work – J. Doe Jul 20 '17 at 08:35