I’m developing a code in which the initial view controller is landscape view. When a button in that view controller is pressed then the next view controller should be portrait. My root view controller is a navigation controller.
This is a story board application.
I returned Yes for UIInterfaceOrientationLandscapeRight in the first root view controller and
UIInterfaceOrientationPortrait for second view controller. But the rotation does not work at first. We have to rotate the view to change it to correct rotation.
How can I resolve this issue?
here one way to change orientation of device is …
here in which class you want to change the orientation then write the line in your
viewWillAppear:methodand also for remove the warning of UIDevice just declare bellow code in your .m file
here this code define above the @implementation file
hope this help you…
🙂